Skip to main content

RelationPlan

@webda/sql-schema


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?​

optional attributes?: string[]

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

For a map: the attributes of the target copied into each item


foreignKey?​

optional foreignKey?: 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?​

optional keySeparator?: 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?​

optional onDelete?: 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?​

optional target?: string

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

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


targetAttribute?​

optional targetAttribute?: 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?​

optional unique?: boolean

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

OneToOne: one row at most per target