OptionalasThe 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
OptionalforeignThe configuration of the foreign key Attribute. See Sequelize#define or Model.init for more information about the syntax.
Using a string is equivalent to passing a ForeignKeyOptions object with the ForeignKeyOptions.name option set.
OptionalforeignShould "ON UPDATE", "ON DELETE" and "REFERENCES" constraints be enabled on the foreign key?
This only affects the foreign key that points to the source model. to control the one that points to the target model, set the "foreignKeyConstraints" option in BelongsToManyOptions.inverse.
OptionalhooksIf false the applicable hooks will not be called.
The default value depends on the context.
OptionalinverseThe name of the inverse association, or an object for further association setup.
OptionalotherThe name of the foreign key attribute in the through model (representing the target model) or an object representing
the type definition for the other column (see Sequelize.define for syntax). When using an object, you
can add a name property to set the name of the colum. Defaults to the name of target + primary key of
target
OptionalscopeA key/value set that will be used for association create and find defaults on the target. (sqlite not supported for N:M)
OptionalsourceThe name of the attribute to use as the key for the association in the source table. Defaults to the primary key attribute of the source model
OptionaltargetThe name of the attribute to use as the key for the association in the target table. Defaults to the primary key attribute of the target model
The name of the table that is used to join source and target in n:m associations. Can also be a Sequelize model if you want to define the junction table yourself and add extra attributes to it.
OptionalthroughConfigures the name of the associations that will be defined between the source model and the through model, as well as between the target model and the through model.
OptionalfromSource?: stringThe name of the HasMany association going from the Source model to the Through model.
By default, the association will be the name of the BelongsToMany association
OptionalfromTarget?: stringThe name of the HasMany association going from the Target model to the Through model.
By default, the association will be the name of the Inverse BelongsToMany association
OptionaltoSource?: stringThe name of the BelongsTo association going from the Through model to the Source model.
By default, the association name will be the name of the inverse BelongsToMany association, singularized.
OptionaltoTarget?: stringThe name of the BelongsTo association going from the Through model to the Target model.
By default, the association name will be the name of the parent BelongsToMany association, singularized.
Options provided when associating models with belongsToMany relationship.
Used by Model.belongsToMany.