12

Imagine I have the following flyway migrations:

  • V1__create_table.sql
  • V2__create_table.sql
  • V4__create_table.sql

And these migrations have been applied to my database. Is there a possibility to add the following script:

  • V3__create_table.sql

And let flyway run this migration out of order without complaining?

Karol Dowbecki
  • 43,645
  • 9
  • 78
  • 111
Titulum
  • 9,928
  • 11
  • 41
  • 79

1 Answers1

19

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.

Karol Dowbecki
  • 43,645
  • 9
  • 78
  • 111
  • 1
    Thanks! I see this is on the `command line` documentation page, but I can't seem to find it anywhere else. Is this property supported by the Spring Boot implementation? – Titulum Feb 13 '20 at 11:50
  • 5
    `spring.flyway.out-of-order` as per https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html – Karol Dowbecki Feb 13 '20 at 11:51