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

Commit bd4b6c78 by =

added addProjects and addUser instance methods to documentation for belongs-to-many relationships

1 parent abb9bd96
Showing with 1 additions and 1 deletions
...@@ -154,7 +154,7 @@ This will create a new model called UserProject with with the equivalent foreign ...@@ -154,7 +154,7 @@ This will create a new model called UserProject with with the equivalent foreign
Defining `through` is required. Sequelize would previously attempt to autogenerate names but that would not always lead to the most logical setups. Defining `through` is required. Sequelize would previously attempt to autogenerate names but that would not always lead to the most logical setups.
This will add methods `getUsers`, `setUsers`, `addUsers` to `Project`, and `getProjects`, `setProjects` and `addProject` to `User`. This will add methods `getUsers`, `setUsers`, `addUser`,`addUsers` to `Project`, and `getProjects`, `setProjects` and `addProject`, `addProjects` to `User`.
Sometimes you may want to rename your models when using them in associations. Let's define users as workers and projects as tasks by using the alias (`as`) option. We will also manually define the foreign keys to use: Sometimes you may want to rename your models when using them in associations. Let's define users as workers and projects as tasks by using the alias (`as`) option. We will also manually define the foreign keys to use:
```js ```js
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!