You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Behaviour of alias (as) to foreignKey translations in associations should be synchronized. #5267
Right now the various associations (hasOne, belongsTo, hasMany, etc) treat aliases differently when attempting to create implicit, not defined, foreignKey names. This behaviour should be made consistent across all the different associations, either by using the alias as the foreignkey or not using it or by requiring an explicit foreignKey definition when using an alias as part of an association definition.
@mickhansen@janmeier@sushantdhiman Could one of you re-open this issue so we can discuss whether to change the keys created by belongsToMany() to use as or not?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment 🙂
Activity
sushantdhiman commentedon May 24, 2016
Who is already using proper
asbehaviorhasOnehttps://github.com/sequelize/sequelize/blob/master/lib/associations/has-one.js#L50belongsTohttps://github.com/sequelize/sequelize/blob/master/lib/associations/belongs-to.js#L50hasManyhttps://github.com/sequelize/sequelize/blob/master/lib/associations/has-many.js#L75belongsToManyhttps://github.com/sequelize/sequelize/blob/master/lib/associations/belongs-to-many.js#L116Task 5267, Make all association to prefer `as` their foreign key name (…
overlookmotel commentedon Jun 20, 2016
@mickhansen @janmeier @sushantdhiman Could one of you re-open this issue so we can discuss whether to change the keys created by
belongsToMany()to useasor not?stale commentedon Aug 12, 2017
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment 🙂