SchemaMigrationsHistory to determine unapplied out of order migrations #31
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.
This commit adds a
SchemaMigrationsHistory
table which:Provides users with more information about the time and order in
which migration scripts were applied to their database. This is exposed
via the
wrench migrate history
commandAllows out of order migration scripts to be applied to a database by
determining what subset of migrations are yet to be applied in contrast
to comparing a single version number. This flexibility allows production
hotfixes to be applied on a diverging branch and having those changes
merged back to non production environments which may already be ahead of
production.
In addition to the new functionality around
SchemaMigrationsHistory
,existing users of wrench will have their databases upgraded to use the
new tracking table by backfilling the missing history. New users of
wrench will have both
SchemaMigrations
andSchemaMigrationsHistory
from the start and no backfilling is necessary.
Resolves #29