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

Commit 48f778d5 by Bryan Tong

possible fix for #2416 by dropping indexes from the creation of many-to-many relation tables

1 parent 98becc4f
Showing with 3 additions and 6 deletions
...@@ -131,14 +131,11 @@ module.exports = (function() { ...@@ -131,14 +131,11 @@ module.exports = (function() {
} }
if (typeof this.through.model === 'string') { if (typeof this.through.model === 'string') {
var defineOptions = _.extend(this.options, { this.through.model = this.sequelize.define(this.through.model, {}, _.extend(this.options, {
tableName: this.through.model, tableName: this.through.model,
indexes: {}, //we dont want indexes here (as referenced in #2416)
paranoid: false // A paranoid join table does not make sense paranoid: false // A paranoid join table does not make sense
}); }));
//we dont want indexes here
delete defineOptions.indexes;
console.log(defineOptions);
this.through.model = this.sequelize.define(this.through.model, {}, defineOptions);
if (this.targetAssociation) { if (this.targetAssociation) {
this.targetAssociation.through.model = this.through.model; this.targetAssociation.through.model = this.through.model;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!