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.