I am trying to update the relationship between tables in my model files that have a many-to-many relationship. I am currently getting errors with a command that I am trying to use to the default nature that the relationship must be unique. As a result I want to make the simple adjustment of adding a property to my belongsToMany
with unique: false
, but I am not sure the proper format to use in the migration file. There doesn't seem to be any documentation on a queryInterface
command for changing classMethod
. Do I even need a migration file?
I want to change this:
classMethods: {
associate: function(db) {
User.belongsToMany(db.Organization, { through: 'member', foreignKey: 'user_id'}),
User.belongsToMany(db.Team, { through: 'member', foreignKey: 'user_id'})
},
to this (unique: false
)
classMethods: {
associate: function(db) {
User.belongsToMany(db.Organization, { through: 'member', unique: false, foreignKey: 'user_id'}),
User.belongsToMany(db.Team, { through: 'member', unique: false, foreignKey: 'user_id'})
},