dbmate check for testing migrations can be rolled back?
#798
fragglet
started this conversation in
Feature Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi, as mentioned in the top-level README:
Rollbacks are obviously incredibly important and it would be nice to have the confidence that a migration not only has a
migrate:downstep, but that it definitely functions as an inverse of themigrate:upstep - even if one has been implemented, you don't know it works until it has really been tested.It would be nice if there was something like a
dbmate checkordbmate testcommand. Such a command would create an empty (eg. in-memory) database, automatically run through all migrations while saving the schema at each step, then automatically run through all rollbacks and check the schema matches at each stage, printing a detailed error message if any discrepancy is found. Then a user can add the check to their CI system.Apologies if this is not a new idea - I couldn't find anything like it described in the documentation, and I also checked past feature requests. I'd potentially be willing to implement such a feature if you think it's a good idea.
All reactions