-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Programmatically undo a migration #1671
Comments
This is already supported: https://github.com/launchbadge/sqlx/tree/master/sqlx-cli#reverting-migrations |
Oh I see, I need the Cli crate to do that, right? |
Yeah, I'm not aware of a (straight-forward) way to undo migrations from within application code. |
There is one PR that does the job, now it seems complicated to get it reviewed 😅 |
Considering #1675 has been merged, I'll close this issue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👋 Hi everyone and thank you for the nice work you do on this crate.
I've been digging a bit in the migration source code and I didn't find anything related to undoing a migration.
I usually use that feature (that I implement myself most of the time) between each of my end to end tests so that the database restarts fresh.
I'd be happy to contribute by adding a
undo
method similar to therun
method found here.Also, having a parameter to specify the target version would probably be useful ("undo the migration until the version 4" for example).
Would that be interesting?
The text was updated successfully, but these errors were encountered: