不要怂,就是干,撸起袖子干!

Commit 70551a5f by Sascha Depold

use assocName and backAssocName for key generation of n-to-m assocs

1 parent 2788d645
Showing with 2 additions and 2 deletions
......@@ -51,8 +51,8 @@ exports.SequelizeTable = function(Sequelize, sequelize, tableName, attributes, o
if(association.backAssociationName) {
// many to many relation
var _attributes = {}
_attributes[table.identifier] = Sequelize.INTEGER
_attributes[association.table.identifier] = Sequelize.INTEGER
_attributes[Sequelize.Helper.SQL.asTableIdentifier(association.name)] = Sequelize.INTEGER
_attributes[Sequelize.Helper.SQL.asTableIdentifier(association.backAssociationName)] = Sequelize.INTEGER
sequelize.define(Sequelize.Helper.SQL.manyToManyTableName(association.name, association.backAssociationName), _attributes)
} else {
// one to many relation
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!