-
Notifications
You must be signed in to change notification settings - Fork 45
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
backend: Add migration down support #604
Conversation
The |
I think maybe we can an argument support to migrate-down, so users can do: Users can use git to get the last migration for a past version: Alternatively we could add a command called (but this command would only be available in new versions, so maybe it's not so useful when users have git) WDYT? |
Makes sense to use the migration id for migrate down, I will add the documentation for the same. |
Added docs for migrating to an older version of Nebraska. |
A test for verifying migrations down work would be useful. |
Added test 👍🏽 |
Awesome. Thanks! |
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.
Found an issue in the docs.
BTW, --migrate-down-to
sounds a bit complicated and is unrelated to DBs. Should we rename it as --migrate-db-to
and support migrating up as well? (maybe in the beginning we can just support migrating down, but it's important that the command name makes sense)
docs/migrate-to-older-version.md
Outdated
|
||
> git show <NEBRASKA-VERSION>:./backend/pkg/api/db/migrations | tail -n1 | ||
|
||
For example to find the migrations that were introduced as part of `2.4.0` release clone the Nebraska repo and run. |
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.
I think this article is a bit confusing. The command associated with this phrase doesn't necessarily show the newly added files in this folder for this tag, it just lists the contents of that dir, for that tag (so it is the same result for 2.4.1).
It should instead say that if users want to migrate to a version, like 2.4.0, they should run the command you wrote (gets them the last migration considered in 2.4.0) and run the --migrate-down-to 0013
.
Does Sorry I misunderstood the |
this patch adds support to revert migrations using the --migrate-down flag. Signed-off-by: Santhosh Nagaraj S <[email protected]>
this patch fixes the errors in migrate down queries. Signed-off-by: Santhosh Nagaraj S <[email protected]>
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.
Left a comment about the command's name. Also, I don't think the docs were updated.
this patch adds documentation for migrating to a older version of Nebraska. Signed-off-by: Santhosh Nagaraj S <[email protected]>
No description provided.