Maven flyway Found non-empty schema(s) "PUBLIC" but no schema history table

123
June 12, 2022, at 10:00 AM

I am just learning Spring Boot with Maven and I have encountered an error that I cannot resolve. I have attached a dependency from Flyway and when I want to install it (I'm clicking install on Lifecycle), I get this error:

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

What could be causing this and how to fix it?

I'm using Java 8 and my dependency with Flyway looks like this:

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

Spring Boot is trying to run Flyway migrate as part of a maven goal it has configured.

Found non-empty schema(s) "PUBLIC" but no schema history table.

The error message is stating that the default schema which Flyway is trying to run against, which is PUBLIC, is not empty. As a result, Flyway know needs to know what the state the database before it is able to create a schema history table and migrate.

Use baseline() or set baselineOnMigrate to true to initialize the schema history table.

These are the two ways you can correct this by creating a baseline to build your migrations upon. https://flywaydb.org/documentation/command/baseline

In spring boot, baseline on migrate can be configured with spring.flyway.baselineOnMigrate=true.

Additionally, install in Maven does not mean install the dependencies but builds and puts the build artifacts of your product in your .m2 maven repository.

Rent Charter Buses Company
READ ALSO
How to install jdk 8 on ubuntu server 18.04?

How to install jdk 8 on ubuntu server 18.04?

I am trying to install JDK 8 ON Ubuntu server 1804 LTS, with the following commands:

125
Spring circular references prohibited in 2.6 version

Spring circular references prohibited in 2.6 version

I have an issue for circular reference callingEven if I set true to this option, I cannot fix my issue

154
org.apache.hadoop.security.AccessControlException: SIMPLE authentication is not enabled. Available:[TOKEN, KERBEROS]

org.apache.hadoop.security.AccessControlException: SIMPLE authentication is not enabled. Available:[TOKEN, KERBEROS]

I am trying to execute the hive table query in presto using Kerberos authentication, But it failed

186
Spring boot gradle build failing due to exception &quot;HikariPool$PoolInitializationException&quot; in unit test

Spring boot gradle build failing due to exception "HikariPool$PoolInitializationException" in unit test

Test cases are running fine when we run them individually it only gives this exception when we are trying to create a build

109