Skip to content
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

Closed
jdrouet opened this issue Feb 3, 2022 · 5 comments
Closed

Programmatically undo a migration #1671

jdrouet opened this issue Feb 3, 2022 · 5 comments

Comments

@jdrouet
Copy link
Contributor

jdrouet commented Feb 3, 2022

👋 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 the run 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?

@jplatte
Copy link
Contributor

jplatte commented Feb 3, 2022

@jdrouet
Copy link
Contributor Author

jdrouet commented Feb 3, 2022

Oh I see, I need the Cli crate to do that, right?

@jplatte
Copy link
Contributor

jplatte commented Feb 3, 2022

Yeah, I'm not aware of a (straight-forward) way to undo migrations from within application code.

@jdrouet
Copy link
Contributor Author

jdrouet commented Feb 7, 2022

There is one PR that does the job, now it seems complicated to get it reviewed 😅
#1675

@jdrouet
Copy link
Contributor Author

jdrouet commented Apr 22, 2022

Considering #1675 has been merged, I'll close this issue

@jdrouet jdrouet closed this as completed Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants