Documentation / zerotal / orm / ManyToManyOptions
Interface: ManyToManyOptions
Defined in: packages/orm/src/model/decorators/manyToMany.ts:4
Options for manyToMany.
Properties
pivotTable
pivotTable:
string
Defined in: packages/orm/src/model/decorators/manyToMany.ts:6
Name of the pivot (join) table (e.g. role_user).
pivotForeignKey
pivotForeignKey:
string
Defined in: packages/orm/src/model/decorators/manyToMany.ts:8
Pivot column referencing this (parent) model (e.g. user_id).
pivotRelatedKey
pivotRelatedKey:
string
Defined in: packages/orm/src/model/decorators/manyToMany.ts:10
Pivot column referencing the related model (e.g. role_id).
localKey?
optionallocalKey?:string
Defined in: packages/orm/src/model/decorators/manyToMany.ts:12
Parent local key the pivot FK references. Defaults to 'id'.
relatedKey?
optionalrelatedKey?:string
Defined in: packages/orm/src/model/decorators/manyToMany.ts:14
Related local key the pivot relatedKey references. Defaults to 'id'.
withPivot?
optionalwithPivot?:string[]
Defined in: packages/orm/src/model/decorators/manyToMany.ts:16
Extra pivot columns to hydrate onto each related model's pivot bag.
withTimestamps?
optionalwithTimestamps?:boolean
Defined in: packages/orm/src/model/decorators/manyToMany.ts:18
Maintain created_at / updated_at on the pivot table during attach/sync.