Hello, I have an issue creating a many to many association with fixtures.
In lib/loader.js#L191, assoc.target.findOne is using the plural form of the Team table and therefore the request fails because it cannot find the table.
I don't understand if my model is wrong or if it is an issue in this project.
Can you help me?
Context:
- node v6.2.1
- sequelize@3.24.0
Model:
var User = sequelize.define('User', { [...] });
var Team = sequelize.define('Team', { [...] });
User.belongsToMany(Team, {
as: 'Teams',
foreignKey: 'userId',
through: 'users_teams'
});
Team.belongsToMany(User, {
as: 'members',
foreignKey: 'teamId',
through: 'users_teams'
});
Fixture:
[{
"model": "User",
"data": {
[...],
"Teams":[{
[...],
"_through":"users_teams"
}]
}
}]
Resulting SQL request:
SELECT [...] FROM `Teams` AS `Team` WHERE [...] LIMIT 1;
Hello, I have an issue creating a many to many association with fixtures.
In lib/loader.js#L191,
assoc.target.findOneis using the plural form of the Team table and therefore the request fails because it cannot find the table.I don't understand if my model is wrong or if it is an issue in this project.
Can you help me?
Context:
Model:
Fixture:
Resulting SQL request: