mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-02 16:16:02 +00:00
fix: update OneToOneRelation and PolymorphicRelation configurations
Enhanced OneToOneRelation to allow source to create target with a mapping field and added a limit. Updated PolymorphicRelation to return a TextField for entity_id instead of NumberField, improving type consistency.
This commit is contained in:
@@ -5,6 +5,7 @@ import { type RelationType, RelationTypes } from "./relation-types";
|
||||
|
||||
/**
|
||||
* Both source and target receive a mapping field
|
||||
* Source gets the mapping field, and can $create the target
|
||||
* @todo: determine if it should be removed
|
||||
*/
|
||||
export type OneToOneRelationConfig = ManyToOneRelationConfig;
|
||||
@@ -17,6 +18,7 @@ export class OneToOneRelation extends ManyToOneRelation {
|
||||
inversedBy,
|
||||
sourceCardinality: 1,
|
||||
required,
|
||||
with_limit: 1,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user