Search code examples
flyway

How to control execution order of flyway repeatable scripts


Is there any way to control execution order of repeatable migration scripts in flyway? I want to run a repeatable migration script after all other repeatable or versioned scripts on checksum change.


Solution

  • Repeatable scripts appear to be controlled by the name following the R__ suffix, first numeric, then alpha upper case, then alpha lower case.

    Instead of being run just once, they are (re-)applied every time their checksum changes.

    Within a single migration run, repeatable migrations are always applied last, after all pending versioned migrations have been executed.

    https://flywaydb.org/documentation/migrations#repeatable-migrations