jsha / blocktogether

Share your blocks and subscribe to others'
GNU General Public License v3.0
330 stars 68 forks source link

Upgrade to sequelize 3.0.0+ #192

Closed jsha closed 9 years ago

jsha commented 9 years ago

✓ Per the changelog for 2.1.0, this will require replacing all .success() with .then().

jsha commented 9 years ago

✓ Also, per 2.0.0-rc1, "Model.destroy() signature has been changed from (where, options) to (options), options now take a where parameter." There are a few cases that will need to be fixed.

jsha commented 9 years ago

✓ Also, there are a number of places that use includes and refer to the included names that will have to be upcased:

"Model names are now used more verbatim in associations. This means that if you have a model named Task (plural T), or an association specifying { as: 'Task' }, the tasks will be returned as relatedModel.Tasks instead of relatedModel.tasks. For more information and how to mitigate this, see https://github.com/sequelize/sequelize/wiki/Upgrading-to-2.0#inflection-replaces-lingo-and-changes-to-naming-conventions"

jsha commented 9 years ago

✓ "Sequelize now returns promises instead of its custom event emitter from most calls. This affects methods that return multiple values (like findOrCreate or findOrInitialize). If your current callbacks do not accept the 2nd success parameter you might be seeing an array as the first param. Either use .spread() for these methods or add another argument to your callback: .success(instance) -> .success(instance, created)."

jsha commented 9 years ago

✓ "[FEATURE] 1:1 and 1:m marks columns as foreign keys, and sets them to cascade on update and set null on delete. If you are working with an existing DB which does not allow null values, be sure to override those options, or disable them completely by passing constraints: false to your assocation call (M1.belongsTo(M2, { constraints: false}))."

jsha commented 9 years ago

Also read https://github.com/sequelize/sequelize/wiki/Upgrading-to-2.0

jsha commented 9 years ago

Fixed.