Skip to main content
zerotal

Documentation


Documentation / @zerotal/orm / index / MorphToOptions

Interface: MorphToOptions

Defined in: packages/orm/src/model/decorators/morphTo.ts:3

Properties

morphMap

morphMap: Record<string, () => unknown>

Defined in: packages/orm/src/model/decorators/morphTo.ts:5

Maps the discriminator string stored in the _type column to the model factory.


morphTypeColumn?

optional morphTypeColumn?: string

Defined in: packages/orm/src/model/decorators/morphTo.ts:10

Override the _type column name. Defaults to <propertyName>_type. e.g. property commentablecommentable_type.


morphForeignKey?

optional morphForeignKey?: string

Defined in: packages/orm/src/model/decorators/morphTo.ts:15

Override the _id column name. Defaults to <propertyName>_id. e.g. property commentablecommentable_id.