Type alias BelongsToDefinition

BelongsToDefinition: {
    foreignKey?: string;
    model: string;
    polymorphic?: false;
    type: BELONGS_TO;
}

The regular "belongsTo" relation.

Type declaration

  • Optional foreignKey?: string
  • model: string
  • Optional polymorphic?: false
  • type: BELONGS_TO

Example: Required options only.

{
type: RelationType.BELONGS_TO,
model: 'model',
}

Example: Verbose definition.

{
type: RelationType.BELONGS_TO,
model: 'model',
foreignKey: 'modelId',
}

Generated using TypeDoc