Skip to main content
zerotal

Documentation


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?

optional localKey?: string

Defined in: packages/orm/src/model/decorators/manyToMany.ts:12

Parent local key the pivot FK references. Defaults to 'id'.


relatedKey?

optional relatedKey?: string

Defined in: packages/orm/src/model/decorators/manyToMany.ts:14

Related local key the pivot relatedKey references. Defaults to 'id'.


withPivot?

optional withPivot?: string[]

Defined in: packages/orm/src/model/decorators/manyToMany.ts:16

Extra pivot columns to hydrate onto each related model's pivot bag.


withTimestamps?

optional withTimestamps?: boolean

Defined in: packages/orm/src/model/decorators/manyToMany.ts:18

Maintain created_at / updated_at on the pivot table during attach/sync.