表格:
表关联:
//category_product with category
category.hasMany(category_product,{foreignKey:'category_id'})
category_product.belongsTo(category,{foreignKey:'category_id'})
//category_product with Product
Product.hasMany(category_product,{foreignKey:'product_id'})
category_product.belongsTo(Product, {foreignKey: 'product_id'})
Git bash错误
throw new Error(this.name + '.hasMany called with something that\'s not asubclass of Sequelize.Model');
^
Error: Theme.hasMany called with something that's not a subclass of Sequelize.Model
谢谢!