-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
console: down migrations improvements (close #3503, #4988) #4790
console: down migrations improvements (close #3503, #4988) #4790
Conversation
Review app for commit 1f316be deployed to Heroku: https://hge-ci-pull-4790.herokuapp.com |
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.
@soorajshankar This looks good.
Can we use this PR to fix all such issues of incorrect down migrations statement ordering. There definitely could be more which havent been reported.
Also can we standardize the pattern of ensuring the down migrations statements order across all usages. I like this style of adding up and down migration statements in the same order and then reversing the order of the down migration statements at the end cc: @beerose
Review app for commit b87b8a7 deployed to Heroku: https://hge-ci-pull-4790.herokuapp.com |
@soorajshankar A gentle reminder on the previous comment. it would be nice if this could be made consistent across the codebase. I also noticed an issue while squashing migrations that if a migration does not have an equivalent down migration, that information gets lost once the migrations are squashed. So can we ensure that we add an sql comment |
I think that all migration-related code can be extracted to its own module and maybe even unit tested. This way it'll be easier to enforce some behaviors and consistency. Also, some repeated parts like calling @soorajshankar We can discuss the details and brainstorm some ideas on how to approach this. |
…o chore/migration-schema-down-changes
…com/soorajshankar/graphql-engine into chore/migration-schema-down-changes
Review app for commit da21269 deployed to Heroku: https://hge-ci-pull-4790.herokuapp.com |
Review app for commit d6b0f0d deployed to Heroku: https://hge-ci-pull-4790.herokuapp.com |
Review app for commit 7c53a78 deployed to Heroku: https://hge-ci-pull-4790.herokuapp.com |
Review app for commit 680afdc deployed to Heroku: https://hge-ci-pull-4790.herokuapp.com |
This PR currently has a merge conflict. Please resolve this and then re-add the |
@soorajshankar I still dont see a down migration with a comment created when running sql from raw sql page. |
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.
down migration with comment not created for sql run in raw sql page
Review app for commit 3190c58 deployed to Heroku: https://hge-ci-pull-4790.herokuapp.com |
…o chore/migration-schema-down-changes
Description
Down migration of a renamed column fails because of the order of down migration was not reversed.
Changelog
CHANGELOG.md
is updated with user-facing content relevant to this PR.Affected components
Related Issues
close #3503, #4988
Solution and Design
schemaChangesDown
andschemaChangesDown
were getting stacked on the same order. I have reversedschemaChangesDown
just before callingmakeMigrationCall
.Now even if the column is renamed, the down migration works correctly.
This PR will also, add SQL comments in down schema when there is no down schema changes
Steps to test and verify