
(Remember to add the attributes to the through model) The model used to join both sides of the N:M association.Ī key/value set that will be used for association create and find defaults on the through model. Can also be a sequelize model if you want to define the junction table yourself and add extra attributes to it. The name of the table that is used to join source and target in n:m associations. Otherwise the profile will be deleted without invoking any hooks For example if User.hasOne(Profile, ), the before-/afterDestroy hooks for profile will be called when a user is deleted.

Set to true to run before-/afterDestroy hooks when an associated model is deleted because of a cascade. If additional attributes are specified, along with group clauses, set plain to false to return all values of all returned rows. When true, the first returned value of aggregateFunction is cast to dataType and returned. If field is a field in this Model, the default will be the type of that field, otherwise defaults to float.Īpplies DISTINCT to the field being aggregated over Pass query execution time in milliseconds as second argument to logging function (options.logging).
#Mysql insert into ignore on duplicate key full
See sequelize.query for full optionsĪ function that gets executed while running the query to log the sql. The function to use for aggregation, e.g. errors/validation C UniqueConstraintError.errors/database C ExclusionConstraintError.dialects/snowflake C SnowflakeQueryInterface.

