Skip to content

Commit

Permalink
Merge branch 'main' into WikiRik-patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
WikiRik authored Oct 14, 2023
2 parents 1069ca8 + 8745c09 commit cba3db3
Show file tree
Hide file tree
Showing 5 changed files with 171 additions and 146 deletions.
25 changes: 0 additions & 25 deletions docs/other-topics/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,31 +327,6 @@ User.belongsToMany(Country, {
});
```

### Through association casing change

In BelongsToMany associations,
Sequelize used to name the association to the through model using the singular name of the target model.

This caused the association to typically be written in pascal case, as that is our recommended naming convention for models.

Starting with Sequelize 7, the association is now named in camel case by default instead. This means the following:

```typescript
const user = await User.findOne({
// assume "countries" is a BelongsToMany association to the Country model, via the UserCountry model.
include: ['countries'],
});

// highlight-next-line
console.log(user.countries[0].UserCountry);
```

should now be written as:

```typescript
console.log(user.countries[0].userCountry);
```

### Changes to `sequelize.sync`

*Pull Request [#14619]*
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@
"@react-hookz/web": "23.1.0",
"clsx": "2.0.0",
"docusaurus-plugin-sass": "0.2.5",
"prism-react-renderer": "2.0.6",
"prism-react-renderer": "2.1.0",
"raw-loader": "4.0.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-feather": "2.0.10",
"react-responsive-carousel": "3.2.23",
"sass": "1.68.0"
"sass": "1.69.3"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.4.3",
"@ephys/eslint-config-typescript": "19.0.2",
"@rushstack/eslint-patch": "1.4.0",
"@rushstack/eslint-patch": "1.5.1",
"@tsconfig/docusaurus": "2.0.1",
"eslint": "8.49.0",
"eslint": "8.51.0",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-mdx": "1.17.1",
"eslint-plugin-react": "7.33.2",
Expand Down
2 changes: 2 additions & 0 deletions static/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
/en/latest/* /v3/:splat 301
/en/v3/* /v3/:splat 301

/docs/v5/other-topics/upgrade /v5/manual/upgrade-to-v5.html 301

/v6/identifiers.html /api/v6/identifiers.html 301
/v6/class/* /api/v6/class/:splat 301
/v6/variable/* /api/v6/variable/:splat 301
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ To recap, the elements of the order array can be the following:
* The content of `raw` will be added verbatim without quoting
* Everything else is ignored, and if raw is not set, the query will fail
* A call to `Sequelize.fn` (which will generate a function call in SQL)
* A call to `Sequelize.col` (which will quoute the column name)
* A call to `Sequelize.col` (which will quote the column name)

### Grouping

Expand Down
Loading

0 comments on commit cba3db3

Please sign in to comment.