Skip to main content

RelationPlan

@webda/sql-schema


Interface: RelationPlan

Defined in: packages/sql-schema/src/plan.ts:114

A relation of a model

Properties​

attribute​

attribute: string

Defined in: packages/sql-schema/src/plan.ts:119


foreignKey?​

optional foreignKey?: string

Defined in: packages/sql-schema/src/plan.ts:140

Name of the foreign key constraint, undefined when the target is not in this plan or foreign keys are disabled


keySeparator?​

optional keySeparator?: string

Defined in: packages/sql-schema/src/plan.ts:144

Separator joining the target composite key into the string the model stores


kind​

kind: RelationKind

Defined in: packages/sql-schema/src/plan.ts:120


model​

model: string

Defined in: packages/sql-schema/src/plan.ts:118

Model declaring the relation


onDelete?​

optional onDelete?: DeletePolicy

Defined in: packages/sql-schema/src/plan.ts:136

ON DELETE of the constraint, when one is created


storage​

storage: RelationStorage

Defined in: packages/sql-schema/src/plan.ts:145


target?​

optional target?: string

Defined in: packages/sql-schema/src/plan.ts:124

Identifier of the related model, undefined when it cannot be resolved


targetAttribute?​

optional targetAttribute?: string

Defined in: packages/sql-schema/src/plan.ts:128

For a query: the attribute of the target model linking back to this model


unique?​

optional unique?: boolean

Defined in: packages/sql-schema/src/plan.ts:132

OneToOne: one row at most per target