joellis13
joellis13

Reputation: 71

baseline-on-migrate with Flyway and Spring Boot

I have seen this posted before but I had already implemented the solutions offered and so I am asking again with more detail to my specific situation. I am trying to integrate Flyway in my SpringBoot app (using H2). I have added the following to the pom.xml:

<dependency>
    <groupId>org.flywaydb</groupId>
    <artifactId>flyway-core</artifactId>
</dependency>

and to application.properties I have tried both:

flyway.baselineOnMigrate=true

and:

flyway.baseline-on-migrate=false

but I consistently get the error:

Found non-empty schema(s) "PUBLIC" without schema history table! Use baseline() or set baselineOnMigrate to true to initialize the schema history table.

I have tried a variety of other solutions I've seen posted, including adding Flyway as a plugin and not just dependency in the POM, but nothing seems to be working. Does anyone know what I'm missing? Thanks!

Upvotes: 4

Views: 5835

Answers (1)

pedrohreis
pedrohreis

Reputation: 1090

I know it is a bit old question, but in Spring boot 2.x you should use spring.flyway.baseline-on-migrate = true instead

Upvotes: 2

Related Questions