sequelize/sequelize — pull request #1477 by janmeier (2014-03-07 16:35:05+00:00)
Title: Enabled onDelete and onUpdate constraints for n:m

Aaaaand a bit more :)

This PR turned out slightly bigger (no. of lines changed wise at least) than I had expected.

Lets take the changes one at a time
* I've removed synconassocation. I seem to remember it has raised errors for some users before. Because of the other changes in this pr (automatic foreign keys, meaning tables need to be synced in a specific order) that error also begun to appear in tests, so I decided to remove it completely
* I've made it possible to specify onDelete and onUpdate constraints for n:m, in the same way as for 1:n and 1:1.
* I've assigned default values for onDelete and onUpdate.
* n:m - cascade on both update and delete
* 1:1 and 1:n - cascade on update and set null on delete
* Can be disabled by passing { useConstraints : false } to the assocation call `M1.hasMany(M2, { useConstraints: false })`. Should we perhaps also have a global options to disable them?
* Through models made by sequelize are never paronoid now. I can't really see a case where you want to keep the join table relation?