Interface MultiAssociationOptions<ForeignKey>

Options provided for many-to-many relationships

Type Parameters

  • ForeignKey extends string

Hierarchy

Properties

as?: string | { plural: string; singular: string }

The alias of this model, in singular form. See also the name option passed to sequelize.define. If you create multiple associations between the same tables, you should provide an alias to be able to distinguish between them. If you provide an alias when creating the association, you should provide the same alias when eager loading and when getting associated models. Defaults to the singularized name of target

foreignKey?: ForeignKey | ForeignKeyOptions<ForeignKey>

The configuration of the foreign key Attribute. See define or init for more information about the syntax.

Using a string is equivalent to passing a ForeignKeyOptions object with the name option set.

foreignKeyConstraints?: boolean

Should ON UPDATE, ON DELETE, and REFERENCES constraints be enabled on the foreign key.

hooks?: boolean

If false the applicable hooks will not be called. The default value depends on the context.

Default

true

A key/value set that will be used for association create and find defaults on the target. (sqlite not supported for N:M)

Generated using TypeDoc