RelationInfo.manyToOne constructor
RelationInfo.manyToOne({})
Create a many-to-one relation (this model belongs to target).
Implementation
factory RelationInfo.manyToOne({
required String name,
required String targetModel,
required String foreignKey,
List<String> references = const ['id'],
String? inverseRelation,
}) {
return RelationInfo(
name: name,
type: RelationType.manyToOne,
targetModel: targetModel,
foreignKey: foreignKey,
references: references,
inverseRelation: inverseRelation,
isOwner: true, // Many side owns the FK
);
}