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

Commit d65753a6 by Y Kang

Fix type in Associations.md

Corrected the spelling of 'constriants' to 'constraints'.
1 parent 10b93eab
Showing with 1 additions and 1 deletions
...@@ -350,7 +350,7 @@ The relation between task and user injects the `user_id` foreign key on tasks, a ...@@ -350,7 +350,7 @@ The relation between task and user injects the `user_id` foreign key on tasks, a
For 1:1 and 1:m associations the default option is `SET NULL` for deletion, and `CASCADE` for updates. For n:m, the default for both is `CASCADE`. This means, that if you delete or update a row from one side of an n:m association, all the rows in the join table refrencing that row will also be deleted or updated. For 1:1 and 1:m associations the default option is `SET NULL` for deletion, and `CASCADE` for updates. For n:m, the default for both is `CASCADE`. This means, that if you delete or update a row from one side of an n:m association, all the rows in the join table refrencing that row will also be deleted or updated.
Adding constriants between tables means that tables must be created in the database in a certain order, when using `sequelize.sync`. If Task has a reference to User, the User table must be created before the Task table can be created. This can sometimes lead to circular references, where sequelize cannot find an order in which to sync. Imagine a scenario of documents and versions. A document can have multiple versions, and for convenience, a document has an reference to it's current version. Adding constraints between tables means that tables must be created in the database in a certain order, when using `sequelize.sync`. If Task has a reference to User, the User table must be created before the Task table can be created. This can sometimes lead to circular references, where sequelize cannot find an order in which to sync. Imagine a scenario of documents and versions. A document can have multiple versions, and for convenience, a document has an reference to it's current version.
```js ```js
var Document = this.sequelize.define('Document', { var Document = this.sequelize.define('Document', {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!