【发布时间】:2018-11-30 10:33:50
【问题描述】:
表格:
表格关联:
//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
谢谢!
【问题讨论】:
-
此链接可能对您有所帮助stackoverflow.com/a/44076602/2893413
标签: mysql sequelize.js