Forum

Error: .belongsToMa...
 
Notifications
Clear all

Error: .belongsToMany called with something that's not a subclass of Sequelize.Model5

1 Posty
1 Users
0 Likes
1,242 Widok
0
Topic starter

can't create table

1 Answer
0
Topic starter

if you’re using objects instead of string-names the you should replace

Project.belongsToMany('User', {through: 'UserProject'});
User.belongsToMany('Project', {through: 'UserProject'});

with

Project.belongsToMany(this.User, {through: 'UserProject'});
User.belongsToMany(this.Project, {through: 'UserProject'});

Odpowiedź

Author Name

Author Email

Your question *

Preview 0 Revisions Saved
Share: