Create 'all-combinations' subcommand #87
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(Depends on and includes #85)
This is an idea that I have been thinking about for a while. It would be nice if migration libraries supported a feature to verify all your up and down migrations and that they work together. A first step in a straightforward integration test scenario would be to continously run migrations
to make sure generally that you can go all the way up, all the way back down and again all the way up. I imagine this catches most cases of bad down migrations.
However, there are special cases where Up-Down-Up is not enough. Consider the following scenario:
001_create_card.up.sql:
001_create_card.down.sql:
002_pin_code.up.sql:
002_pin_code.down.sql:
There is a bug in 002_pin_code.down.sql. The column is dropped instead of dropping the 'NOT NULL' contraint. However, when running all down migrations in a sequence it would go unnoticed since 001_create_card.down.sql drops the entire table. The only way to catch this migration bug is to run 002_pin_code.down.sql directly followed by 002_pin_code.up.sql.
I believe therefor that it would be useful to provide a tool that iterates through all up and down migration scenarios to uncover hidden incompatibles between migrations. Therefore I would like to create an
all-combinations
subcommand.