Imagine I have the following flyway migrations:
And these migrations have been applied to my database. Is there a possibility to add the following script:
And let flyway run this migration out of order without complaining?
Description. Allows migrations to be run “out of order”. If you already have versions 1.0 and 3.0 applied, and now a version 2.0 is found, it will be applied too instead of being ignored.
The hotfix migration can be deployed with Flyway with skipExecutingMigrations=true . The schema history table will be updated with the new migration, but the script itself won't be executed again. skipExecutingMigrations can be used with with cherryPick to skip specific migrations.
Flyway runs each migration in a separate transaction. In case of failure this transaction is rolled back.
To execute the rollback, call the following flyway commands in sequence. This runs all undo scripts starting from the current release, version 129, back to version 123. This will run the repeatable migrations, bringing the programmable object versions back to the state they had been in version 123.
Flyway 2 has flyway.outOfOrder
property which is by default false
You would have to set it to true
to run your missing migration, as per migrate
docs:
Allows migrations to be run "out of order".
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With