const ProductModelSize = sequelize.define(
'product_model_size',
{
sizeId: { type: DataTypes.INTEGER, allowNull: false },
productModelId: { type: DataTypes.INTEGER, allowNull: false },
isAvailable: { type: DataTypes.BOOLEAN, defaultValue: true },
},
{
timestamps: false,
}
)
await model.addSizes([1, 2], { through: { isAvailable: false } })