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

SchemaMigrationsHistory to determine unapplied out of order migrations #31

Closed
wants to merge 1 commit into from

Conversation

RoryQ
Copy link

@RoryQ RoryQ commented Jun 16, 2020

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 command

  • Allows 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 and SchemaMigrationsHistory
from the start and no backfilling is necessary.

Resolves #29

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` command

- Allows 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` and `SchemaMigrationsHistory`
from the start and no backfilling is necessary.
@Galaf
Copy link

Galaf commented Nov 14, 2022

Yes, please :)

@kazegusuri kazegusuri closed this Aug 30, 2023
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

Successfully merging this pull request may close these issues.

Support out of order migrations
3 participants