-
Notifications
You must be signed in to change notification settings - Fork 127
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
Support rollback/undo migrations #121
Comments
Hi! thanks for your interest, when I started refinery flyway did not offer undo migrations, even if they do now their opinion on the subject is the same , I share the same view, I think they are counter productive. |
Prompt answer, thanks. Flyway solution to avoid undo migrations has two parts:
Which does not help in case when I'm developing a migration and want to apply/rollback changes many times.
Nice, however it brings additional complexity to the project ecosystem and, in fact, is required when project uses refinery. That may be an overhead for smaller projects. |
No worries, this discussion hasn't been had here on github before, so it's nice that its also here now. The gist is this:
overall I don't think the concept makes sense, imho if one wants to undo a change they should just write the part of it they want to undo on a new migration and keep it going forward. It's easier to understand less bug prone, and less code to be maintained |
For me, the primary benefit of an undo/rollback is for development. It's a huge pain to have to apply a newly made "undo" migration or just to drop stuff manually if I find I need some minor change a user will never see mid development Maybe having some method of wiping clean everything it adds in via migrations and then a seeding a fresh application of migrations with development data instead? That way I can do something like, tweak a fields nullability, defaultness, uniqness, spelling, etc until I'm happy with both the schema AND code quickly and efficiently, vs just suffering my way through the manual rollbacks and reapplications that should only exist in the development cycle. I myself don't want to support rolling back come a cut release for the reasons you describe, but I still need a quick way to undo and redo a migration if I miss a letter in a word... (This is likely more a refinery-cli thing I would say though) |
Definitely more as a development utility, I find it useful to undo a migration when switching branches and code reviewing something, then having the ability to quickly revert back to master's schema version. |
I've been building a evaluation matrix of migration management tools for a new product, and nearly all the tools we're considering have some mechanism for reverting changes to assist with development. This is a core feature for large development teams which will have lots of proposed schema changes being developed simultaneously. https://github.com/prisma/prisma is the only widely used tool that I've found so far which doesn't have explicit "undo" support, but it has a separate workflow for prototyping schema changes - see https://www.prisma.io/docs/guides/database/prototyping-schema-db-push |
From the readme/Rollback section:
However according to this, undo is actually supported by Flyway.
Personally, I don't see how it is possible to switch between different branches of my project and work with the same database if refinery does not allow you to rollback changes.
My proposal is it to:
The text was updated successfully, but these errors were encountered: