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

Commit 72afaf08 by Jan Aagaard Meier

Merge pull request #3593 from simong/belongs-to-many-target-reference

Default target reference in belongsToMany association to CASCADE
2 parents d0c3a16f ce58b153
Showing with 2 additions and 2 deletions
......@@ -276,8 +276,8 @@ module.exports = (function() {
targetAttribute.onDelete = this.through.model.rawAttributes[this.foreignIdentifier].onDelete || this.options.onDelete;
targetAttribute.onUpdate = this.through.model.rawAttributes[this.foreignIdentifier].onUpdate || this.options.onUpdate;
if (!targetAttribute.onDelete) sourceAttribute.onDelete = 'CASCADE';
if (!targetAttribute.onUpdate) sourceAttribute.onUpdate = 'CASCADE';
if (!targetAttribute.onDelete) targetAttribute.onDelete = 'CASCADE';
if (!targetAttribute.onUpdate) targetAttribute.onUpdate = 'CASCADE';
}
this.through.model.rawAttributes[this.identifier] = Utils._.extend(this.through.model.rawAttributes[this.identifier], sourceAttribute);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!