-
Notifications
You must be signed in to change notification settings - Fork 2.8k
cli: add --goto flag in hasura migrate apply (close #2689) #3715
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
Conversation
|
Deploy preview for hasura-docs ready! Built with commit 3787058 |
|
Review app for commit 3787058 deployed to Heroku: https://hge-ci-pull-3715.herokuapp.com |
|
Deploy preview for hasura-docs ready! Built with commit 284f5a1 |
…ion chain are applied
|
Review app for commit 64ecf6d deployed to Heroku: https://hge-ci-pull-3715.herokuapp.com |
|
Review app for commit 2327082 deployed to Heroku: https://hge-ci-pull-3715.herokuapp.com |
|
Review app for commit 9442c9a deployed to Heroku: https://hge-ci-pull-3715.herokuapp.com |
|
Review app for commit 1c0607f deployed to Heroku: https://hge-ci-pull-3715.herokuapp.com |
|
Review app for commit e6e6105 deployed to Heroku: https://hge-ci-pull-3715.herokuapp.com |
…add a couple other small fixes
|
Review app for commit b8384e9 deployed to Heroku: https://hge-ci-pull-3715.herokuapp.com |
|
Review app for commit a575361 deployed to Heroku: https://hge-ci-pull-3715.herokuapp.com |
|
Review app for commit 284f5a1 deployed to Heroku: https://hge-ci-pull-3715.herokuapp.com |
|
Review app for commit 3497b1d deployed to Heroku: https://hge-ci-pull-3715.herokuapp.com |
|
Review app for commit 8e5705e deployed to Heroku: https://hge-ci-pull-3715.herokuapp.com |
|
Review app https://hge-ci-pull-3715.herokuapp.com is deleted |
…ura#3715) * cli: add --goto <version> flag to migrate command * cli: fix error encoutered in goto, when on version -1 * do down migrations one step down * reorganize code * in case of up "gotos" make sure that all previous migration in migration chain are applied * modify readUp and readDown functions to account for --goto use case * refactor to clean up and adopt a better implementation addressing the comments * remove empty error handling step * return ErrNoChange when no migrations were applied * respect m.stop() can panic so place conditional cases after that and add a couple other small fixes * fix bug caused by early checking of versions * fix to add migration_mode and nil version check * add some more examples for migrate apply command Co-authored-by: Aravind Shankar <face11301@gmail.com> Co-authored-by: Shahidh K Muhammed <muhammedshahid.k@gmail.com>
Description
This PR will add a
--gotoflag to thehasura migrate applycommand, which can set version to the specified value while applying all the migrations in the chain leading to it.Let's say we have the following state.
So,
hasura migrate apply --goto 1564702123002, will result in the following status.Affected components
Related Issues
#2689
Breaking changes