-
-
Couldn't load subscription status.
- Fork 9.2k
fix: unique index recreation #24423
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
fix: unique index recreation #24423
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for the PR.
Unfortunately we can't go with this approach quiet yet, we intentionnaly re-inspect the schema to manage cases where users manually add things in there DB or run operations outside Strapi.
If you added an option to switch this behavior on/off that would allows us to move forward with this :)
I've added a |
|
@AlbertoCalvoRubio Thanks that looks pretty good to me, nice catch on the bug. @derrickmehaffy could you give this a try when you can ? I think this is a nice addition that we could make the default in the next major to reduce bootstrap time :) |
Should we also port this to v5? Atm it targets v4 |
|
Hey Alberto, Can you quickly run prettier against this so that test can pass? Likewise would you be willing to open a PR for the documentation to add the option? Specifically for the docs, the repo/branch for v4 is here: https://github.com/strapi/documentation/tree/v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minus the doc requirement and the failing prettier test. Makes sense to me.
|
We pbl have the same thing in v5 I don't recall us changing it so if you can make a PR against develop after that one get's merged that would be 💯 |
I've fixed the formatting issue and created a PR to the documentation repository strapi/documentation#2724. |
Sure, I will do the same for v5 once this gets merged. Thanks for the quick feedback! |
What does it do?
Fix #24421
Why is it needed?
Describe the issue you are solving.
strapi_database_schematable to compare changes to not recreate indexes as the order of the columns array is the same. It also avoids doing a lot of queries to the database to know the current schema if it was already stored in thestrapi_database_schematable.How to test it?
Provide information about the environment and the path to verify the behaviour.
Related issue(s)/PR(s)
Let us know if this is related to any issue/pull request