29

I just upgraded from spring-boot 3.2.3 -> 3.3.0. After the upgrade flyway refuses to connect to postgres:

Caused by: org.flywaydb.core.api.FlywayException: Unsupported Database: PostgreSQL 16.2
    at org.flywaydb.core.internal.database.DatabaseTypeRegister.getDatabaseTypeForConnection(DatabaseTypeRegister.java:105)
    at org.flywaydb.core.internal.jdbc.JdbcConnectionFactory.<init>(JdbcConnectionFactory.java:73)
    at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:134)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:147)

What is the expected way to connect to postgres 16 using spring-boot 3.3.0 and flyway?

3 Answers 3

62

There is pinned issue to announce about extracting database support out from flyway-core.

Try to add this dependency to your project:

<dependency>
    <groupId>org.flywaydb</groupId>
    <artifactId>flyway-database-postgresql</artifactId>
</dependency>
Sign up to request clarification or add additional context in comments.

Comments

10

in your pom.xml add this :

<dependency>
    <groupId>org.flywaydb</groupId>
    <artifactId>flyway-database-postgresql</artifactId>
</dependency>
<dependency>
    <groupId>org.flywaydb</groupId>
    <artifactId>flyway-core</artifactId>
    <version>10.15.2</version>
</dependency>

add also in your application.yml this :

spring:
  flyway:
    enabled: true
    locations: classpath:db/migration
    baseline-on-migrate: true

1 Comment

Will it work with Postgres 16.x ? I'm still getting org.flywaydb.core.api.FlywayException: Unsupported Database: PostgreSQL 16.3
-1

My quick fix was lowering version of flyway dependency to:

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.