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

Commit 1e9a96fe by Jan Aagaard Meier

Use a more reasonable index name for join table unique key

1 parent 0015e1d9
Showing with 2 additions and 1 deletions
......@@ -172,7 +172,8 @@ module.exports = (function() {
combinedTableAttributes[this.identifier] = {type: sourceKeyType, primaryKey: true}
combinedTableAttributes[this.foreignIdentifier] = {type: targetKeyType, primaryKey: true}
} else {
var uniqueKey = this.identifier + this.foreignIdentifier
var uniqueKey = [this.through.tableName, this.identifier, this.foreignIdentifier, 'unique'].join('_')
console.log(uniqueKey)
combinedTableAttributes[this.identifier] = {type: sourceKeyType, unique: uniqueKey}
combinedTableAttributes[this.foreignIdentifier] = {type: targetKeyType, unique: uniqueKey}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!