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(fmt): add quick-fix for missing indexes when relationMode = "prisma" #3431

Merged
merged 9 commits into from Nov 28, 2022

Conversation

Druue
Copy link
Contributor

@Druue Druue commented Nov 22, 2022

Added quickfix to add indexes for relations when RelationMode=Prisma
-- where @@index did not exist

closes #1297

Added quickfix to add indexes for relations when RelationMode=Prisma
fixes #1297

Co-authored-by: Tom tom@tomhoule.com
@Druue Druue added this to the 4.7.0 milestone Nov 22, 2022
@CLAassistant
Copy link

CLAassistant commented Nov 22, 2022

CLA assistant check
All committers have signed the CLA.

@Druue
Copy link
Contributor Author

Druue commented Nov 22, 2022

waiting on #3429

@Druue Druue changed the title feat(fmt): add quick-fix for missing indexes or relationMode = "prisma" feat(fmt): add quick-fix for missing indexes when relationMode = "prisma" Nov 22, 2022
…e end of a block

Updated: `create_missing_unique` ~> `create_missing_attribute` + `create_block_attribute`
@pimeys
Copy link
Contributor

pimeys commented Nov 24, 2022 via email

@Druue Druue marked this pull request as ready for review November 25, 2022 11:52
@Druue Druue requested a review from a team as a code owner November 25, 2022 11:52
@Druue Druue requested review from Jolg42, a team, janpio and tomhoule November 25, 2022 14:10
@Jolg42
Copy link
Member

Jolg42 commented Nov 25, 2022

Let's merge #3447 then rebase this

@Druue Druue requested review from janpio and jkomyno November 25, 2022 17:19
}
},
"severity": 1,
"message": "With `relationMode = \"prisma\"`, no foreign keys are used, so relation fields will not benefit from the index usually created by the relational database under the hood. This can lead to poor performance when querying these fields. We recommend adding an index manually. Learn more at https://pris.ly/d/relation-mode#indexes"
Copy link
Member

Choose a reason for hiding this comment

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

I think the message was updated in the meantime, but as this is just input and expectation at the same time (And does not use the actual correct warning), this should be fine.

(Or should this actually be wired up to the real warning?)

@Jolg42
Copy link
Member

Jolg42 commented Nov 28, 2022

Let's merge this (checked with Soph on Slack) :shipit:

@Jolg42 Jolg42 merged commit 4fed95a into main Nov 28, 2022
@Jolg42 Jolg42 deleted the feat/qf-relation_mode-indexes branch November 28, 2022 09:41
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.

feat: Quick Fix - relationMode : missing foreign keys' indexes
6 participants