RelationPlan
Interface: RelationPlan
Defined in: packages/sql-schema/src/plan.ts:149
A relation of a model
Properties
attribute
attribute:
string
Defined in: packages/sql-schema/src/plan.ts:157
Attribute
attributes?
optionalattributes?:string[]
Defined in: packages/sql-schema/src/plan.ts:173
For a map: the attributes of the target copied into each item
foreignKey?
optionalforeignKey?:string
Defined in: packages/sql-schema/src/plan.ts:185
Name of the foreign key constraint, undefined when the target is not in this plan or foreign keys are disabled
keySeparator?
optionalkeySeparator?:string
Defined in: packages/sql-schema/src/plan.ts:189
Separator joining the target composite key into the string the model stores
kind
kind:
RelationKind
Defined in: packages/sql-schema/src/plan.ts:161
Kind
model
model:
string
Defined in: packages/sql-schema/src/plan.ts:153
Model declaring the relation
onDelete?
optionalonDelete?:ForeignKeyAction
Defined in: packages/sql-schema/src/plan.ts:181
ON DELETE of the constraint, when one is created
storage
storage:
RelationStorage
Defined in: packages/sql-schema/src/plan.ts:193
Storage
target?
optionaltarget?:string
Defined in: packages/sql-schema/src/plan.ts:165
Identifier of the related model, undefined when it cannot be resolved
targetAttribute?
optionaltargetAttribute?:string
Defined in: packages/sql-schema/src/plan.ts:169
For a query or a map: the attribute of the target model linking back to this model
unique?
optionalunique?:boolean
Defined in: packages/sql-schema/src/plan.ts:177
OneToOne: one row at most per target