problem description:
there are three tables
Table relationship description:
the 1.category table holds the directory id and the name. The
2.category_product table stores the id,product_id of the category table corresponding to category_id and the corresponding product table, which contains the details of the product.
current modeling relationship:
in category model
category.hasMany(category_product,{foreignKey:"id",targetKey:"category_id"})
in category_product model
category_product.belongsTo(Product, {foreignKey: "product_id",targetKey: "id"})
< hr >
error problem:
SequelizeDatabaseError: Unknown column "category_product.id" in "field list"