Existing Flyway migrations fail validation after upgrade to Spring Boot 2.4.2

Viewed 4751

I just upgraded my Spring Boot application from 2.3.5.RELEASE to 2.4.2. Now, when I try to start my application on an existing database, the Flyway migration fails with Validate failed: Migrations have failed validation. There's no details or other messages, just this one. Usually Flyway will inform me about checksum mismatches or other issues, but in this case there's nothing.

Did I miss some backwards incompatible change, either in Spring (Boot) or in Flyway? How do I fix my migrations?

2 Answers

I had a similar issue with spring Boot 2.4.2 and Flyway with the same error message "Validate failed: Migrations have failed validation" without any more details.

It happened because I had a gap between my scripts versions numbers. I had to add ignoreMissingMigrations(true) in the flyway configuration to make it work again.

I don't know why this flyway version do not report the missing migration script anymore...

Flyway 7.1.0 comes with Spring Boot 2.4. However this version of Flyway does not log the validation exceptions correctly (https://flywaydb.org/documentation/learnmore/releaseNotes).

I temporarly manage this dependency by myself by adding following code in the maven pom.xml:

<dependencyManagement>
   <dependencies>
     <dependency>
       <groupId>org.flywaydb</groupId>
       <artifactId>flyway-core</artifactId>
       <version>7.2.1</version>
     </dependency>
   </dependencies>
</dependencyManagement>
Related