Answer the question
In order to leave comments, you need to log in
How to implement Sizes model for products in sequelize?
Please tell me how to implement the Sizes model for products in sequelize so that it is possible to change the presence of n sizes in the admin panel, how to model the table correctly?
I already have a sizes model that has all possible sizes, and a product_variant model that will be populated with values from sizes. But the question is more about where to use the isAvailable: boolean value in order to implement what was intended. I'm currently using a many-to-many relationship.
I will be grateful for the answer
ProductModel.belongsToMany(Size, { through: ProductModelSize, onDelete: 'CASCADE' })
Size.belongsToMany(ProductModel, { through: ProductModelSize, onDelete: 'CASCADE' })
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question