Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: removed incorrect breaking change #591

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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