I updated from Spring Boot 1.5 to 2. As some other, I also faced the issue that by doing the update also Flyway was updated from 3 to 5. The problem with the Flyway update is that the flyway schema table does not get migrated automatically so that the database migrations do not work.
The Spring Boot migration guide suggests to update first to Flyway 4 and then do the update to Spring Boot 2. I did as suggested and included
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.2.RELEASE</version>
</parent>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>4.0</version>
</dependency>
into my POM. Flyway stated that you just need to run the application to apply the migration from version 3 to 4. When I start the application everything works (no error) BUT the schema table of Flyway was NOT migrated. I still see the columns in there which should be removed by the migration (version_rank).
My question now: What do I need to do to trigger the Flyway migration?
Update: Thanks to @M. Deinum! His comment gave me the hint to fix the issue. If you face a similar problem: search through your workspace if you do something with flyway that would bypass Spring Boot auto config.
4.2.0
you are using4.0
. Basically you upgraded to a too low of a version for the initial migration to actually be part of Flyway itself. – M. Deinum