Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-3269

Flyway "Out-of-order" migrations is enabled by default



    • Type: Code Task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.0
    • Fix Version/s: 6.0
    • Component/s: DSpace API
    • Labels:
    • Attachments:
    • Comments:
    • Documentation Status:
      Complete or Committed


      Discovered while fixing DS-3234 and DS-3268.

      By default, on latest master, we have "out of order" migrations enabled for Flyway. This means that if older numbered migrations are added into list of migrations, they will be run.

      As noted in the Flyway docs for "migrate": https://flywaydb.org/documentation/commandline/migrate

      If you already have versions 1 and 3 applied, and now a version 2 is found, it will be applied too instead of being ignored.

      While this isn't dangerous now, I worry this could cause issues for local sites if they are generating their own migrations and expecting the default behavior of Flyway (which is to never run migrations out of order). Flyway itself also warns against this behavior, as we receive this warning in our DSpace logs each time migrations are now run:

      2016-07-19 21:14:22,297 WARN org.flywaydb.core.internal.command.DbMigrate @ outOfOrder mode is active. Migration of schema "public" may not be reproducible.

      From digging around, this looks to have been added into 6.0 to support XML Workflow migrations (see DS-2713). Since it only seems to be used for a single scenario, I'd like to see if we can avoid changing our default value.

      Instead, we might just install XML Workflow using the existing ./dspace database migrate ignored (undocumented) option. This option will run out-of-order (i.e. ignored) migrations on demand (rather than by default). So, we may be able to simply change the XML Workflow docs to require running that command.


          Issue Links



              • Assignee:
                tdonohue Tim Donohue
                tdonohue Tim Donohue
              • Votes:
                1 Vote for this issue
                2 Start watching this issue


                • Created: