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

Commit e202a98a by miclill Committed by Sushant

docs(hooks): specify hooks now prefer Promise (#8181)

1 parent bfb063fa
Showing with 2 additions and 1 deletions
# Hooks # Hooks
Hooks (also known as callbacks or lifecycle events), are functions which are called before and after calls in sequelize are executed. For example, if you want to always set a value on a model before saving it, you can add a `beforeUpdate` hook. Hooks (also known as lifecycle events), are functions which are called before and after calls in sequelize are executed. For example, if you want to always set a value on a model before saving it, you can add a `beforeUpdate` hook.
For a full list of hooks, see [Hooks file](https://github.com/sequelize/sequelize/blob/master/lib/hooks.js#L7). For a full list of hooks, see [Hooks file](https://github.com/sequelize/sequelize/blob/master/lib/hooks.js#L7).
......
...@@ -88,6 +88,7 @@ Sequelize V4 is a major release and it introduces new features and breaking chan ...@@ -88,6 +88,7 @@ Sequelize V4 is a major release and it introduces new features and breaking chan
- The resulting promise from the `Model.validate` instance method will be rejected when validation fails. It will fulfill when validation succeeds. - The resulting promise from the `Model.validate` instance method will be rejected when validation fails. It will fulfill when validation succeeds.
- Raw options for where, order and group like `where: { $raw: '..', order: [{ raw: '..' }], group: [{ raw: '..' }] }` have been removed to prevent SQL injection attacks. - Raw options for where, order and group like `where: { $raw: '..', order: [{ raw: '..' }], group: [{ raw: '..' }] }` have been removed to prevent SQL injection attacks.
- `Sequelize.Utils` is not longer part of the public API, use it at your own risk - `Sequelize.Utils` is not longer part of the public API, use it at your own risk
- `Hooks` should return Promises now. Callbacks are deprecated.
### New features ### New features
- Initial version of `sequelize.sync({ alter: true })` has been added and uses `ALTER TABLE` commands to sync tables. [Migrations](http://docs.sequelizejs.com/manual/tutorial/migrations.html) are still preferred and should be used in production. - Initial version of `sequelize.sync({ alter: true })` has been added and uses `ALTER TABLE` commands to sync tables. [Migrations](http://docs.sequelizejs.com/manual/tutorial/migrations.html) are still preferred and should be used in production.
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!