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

Support ordering of migrations #11

Closed
d-ryan-ashcraft opened this issue Nov 28, 2023 · 1 comment
Closed

Support ordering of migrations #11

d-ryan-ashcraft opened this issue Nov 28, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@d-ryan-ashcraft
Copy link
Contributor

d-ryan-ashcraft commented Nov 28, 2023

In the last major feature planned prior to an initial major version release, we'd like to support basic migration ordering and targeting or migrations. This will not be as complex as something like Flyway, but we'd like to take a cue from them to support the following:

  • A type of migration - either "versioned" or "repeatable" (to be provided as part of the migrations.json definition)
  • Ordered numerically by migration "group and version" tag combination (to be provided as part of the migrations.json definition)
  • "Minimum version" optional parameter will allow control of older group/versions to ignore
  • Each group will be run in its entirety as a unit; groups will not be intermixed
  • The plugin will allow groups to be manually ordered. If no order is specified, then they will be run alphabetically.

This will also be complemented with the ability to inactivate migrations by name.

For instance, an example of migrations might be something like:

{
    "group": "foo",
    "migrations": [
        {
            "name": "repeatableMigrationExample",
            "type": "repeatable"
        },
        {
            "name": "versionedExampleA",
            "type": "versioned",
            "version": "0.9.0"
        },
        {
            "name": "versionedExampleB",
            "type": "versioned",
            "version": "1.0.0"
        },
        {
            "name": "versionedExampleC",
            "type": "versioned",
            "version": "1.1.0"
        }
    ]
}

In the above example, we'd get the following behavior:

Minimum Version repeatableMigrationExample versionedExampleA versionedExampleB versionedExampleC
true true true true
0.9.0 true true true true
1.0.0 true false true true
1.1.0 true false false true
1.1.1 true false false false

This may prove to be too lightweight and more could be needed - we'll likely continue to iterate from here.

@d-ryan-ashcraft d-ryan-ashcraft self-assigned this Nov 29, 2023
@d-ryan-ashcraft d-ryan-ashcraft added this to the 0.2.0 milestone Nov 29, 2023
@d-ryan-ashcraft d-ryan-ashcraft modified the milestones: 0.2.0, 0.3.0 Mar 27, 2024
@d-ryan-ashcraft d-ryan-ashcraft added the enhancement New feature or request label Mar 27, 2024
@jacksondelametter
Copy link
Contributor

Feature has been merged into Baton.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants