Sequelize models are now ES6 classes, so instanceMethods have been moved out of options. They are now set via prototype
options.order now only allows arrays / sequelize methods, not string values
`afterUpdate` is now within the hooks options, and not a direct prototype of a model
Operator aliases are no longer allowed by default (`$lt` must now be `[Op.lt]`)
`findById` is now `findByPk`
`updateAttributes` is now `update`
The instance methods on sequelize models must use the classic function syntax over arrow function syntax, since arrow functions (=>) will lexically bind this to undefined based on the scope, whereas function will dynamically bind this.
The mocha tests began failing on upgrading to v5, as the version of pg we were using was too outdated for sequelize v5, so that has been updated as well.
Updates to following package(s) (fixing vulnerabilities): sequelize
^3.19.0
->^5.21.5
pg^4.4.1
->^7.0.0
There are breaking changes between v3 and v4: https://sequelize.org/v4/manual/tutorial/upgrade-to-v4.html
And breaking changes between v4 and v5: https://sequelize.org/master/manual/upgrade-to-v5.html
The instance methods on sequelize models must use the classic function syntax over arrow function syntax, since arrow functions (
=>
) will lexically bindthis
toundefined
based on the scope, whereasfunction
will dynamically bindthis
.The mocha tests began failing on upgrading to v5, as the version of pg we were using was too outdated for sequelize v5, so that has been updated as well.