hasOne<R extends Model> method
Defines a 1:1 relationship where the Foreign Key resides on the related model R.
Example: User has one Phone. (Phone table has user_id).
Implementation
HasOne<R> hasOne<R extends Model>(
R Function(Map<String, dynamic>) creator, {
String? foreignKey,
String? localKey,
}) {
return HasOne<R>(
_asModel,
creator,
foreignKey ?? Utils.foreignKey(table),
localKey ?? primaryKey,
);
}