0

I create many to many association between two tables

role.js

classMethods: {
  associate: function(models) {
    Role.belongsToMany(models.Permission, {through: 'RolePermission'});
  }

permission.js

classMethods: {
  associate: function(models) {
    Permission.belongsToMany(models.Role, {through: 'RolePermission'});
  }
}

But when I check list of models RolePermission not created. How can I test these associations are done properly. Is there any console for that?

Haseeb Ahmad
  • 7,914
  • 12
  • 55
  • 133

1 Answers1

0

When you do not explicitly define throught model the join table will be created in db when you call sync, but you wont be able to log access with other models.

Also Refer : How to implement many to many association in sequelize

Community
  • 1
  • 1
Keval
  • 3,246
  • 20
  • 28