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

Commit 2e032e0b by Sushant Committed by GitHub

docs(association): document uniqueKey for belongs to many (#12166)

1 parent 55678d2e
...@@ -308,6 +308,12 @@ CREATE TABLE IF NOT EXISTS "ActorMovies" ( ...@@ -308,6 +308,12 @@ CREATE TABLE IF NOT EXISTS "ActorMovies" (
Unlike One-To-One and One-To-Many relationships, the defaults for both `ON UPDATE` and `ON DELETE` are `CASCADE` for Many-To-Many relationships. Unlike One-To-One and One-To-Many relationships, the defaults for both `ON UPDATE` and `ON DELETE` are `CASCADE` for Many-To-Many relationships.
Belongs-To-Many creates a unique key when primary key is not present on through model. This unique key name can be overridden using **uniqueKey** option.
```js
Project.belongsToMany(User, { through: UserProjects, uniqueKey: 'my_custom_unique' })
```
## Basics of queries involving associations ## Basics of queries involving associations
With the basics of defining associations covered, we can look at queries involving associations. The most common queries on this matter are the *read* queries (i.e. SELECTs). Later on, other types of queries will be shown. With the basics of defining associations covered, we can look at queries involving associations. The most common queries on this matter are the *read* queries (i.e. SELECTs). Later on, other types of queries will be shown.
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
"semantic-release": "^17.0.7", "semantic-release": "^17.0.7",
"sinon": "^9.0.2", "sinon": "^9.0.2",
"sinon-chai": "^3.3.0", "sinon-chai": "^3.3.0",
"sqlite3": "^4.0.6", "sqlite3": "^4.1.1",
"tedious": "6.0.0", "tedious": "6.0.0",
"typescript": "^3.6.3" "typescript": "^3.6.3"
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!