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

feat!: make generated association names lowerCamelCase by default #16514

Merged
merged 7 commits into from Jan 31, 2024

Conversation

ephys
Copy link
Member

@ephys ephys commented Sep 15, 2023

Pull Request Checklist

This PR makes association names generated by Sequelize be camelCase instead of PascalCase by default.

Until now, the name of the association was the name (plural or singular, depending) of the target model.

Our documentation uses PascalCase for model names (as they are JS classes) and camelCase for association names & attributes (as they are class fields).

Using the model name as the association name broke that convention, so the new implementation turns it into camelCase.

This is a breaking change, we will need to document that

  • generated association names are camelCase by default
  • their associated foreign key will therefore be camelCase too

@WikiRik
Copy link
Member

WikiRik commented Sep 15, 2023

Not related to your change, but I had to manually cancel the DB2 tests. Check out the timestamps;
image

and compare that to postgres;
image

Should be an easy fix with how we run db2 tests compared to the others, but wanted to comment it somewhere before I forget

@ephys ephys requested a review from WikiRik January 31, 2024 10:14
Copy link
Member

@WikiRik WikiRik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Also some maintenance on the tests, thanks for that!

@WikiRik
Copy link
Member

WikiRik commented Jan 31, 2024

@ephys I'll let you merge this one

@ephys ephys added this pull request to the merge queue Jan 31, 2024
Merged via the queue into main with commit 6800fbd Jan 31, 2024
51 checks passed
@ephys ephys deleted the ephys/association-capitalization branch January 31, 2024 12:38
@wguerram
Copy link

Hi, could you please look this issue. Might be related to this pull request.

https://github.com/sequelize/sequelize/issues/17074

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants