flyway: š¢ Modular Flyway V10 (No database found to handle or Unsupported Database)
It has come to our attention that the move to a more modular Flyway in version V10.0.0 may not have been made clear enough in our release notes.
As we attempt to move towards a much wider range of supported databases and database types we have found ourselves needing to extract database support out from flyway-core and into their own modules in order to improve maintainability and distribution size.
As a result, databases, with the exception of in-memory or file databases such as H2 or SQLite, have been moved into their own packages which need to be added to your project when upgrading to Flyway V10.0.0. This includes whether you are using Flyway as a dependency in your project or using the Gradle or Maven plugins.
The list of additional dependencies can be seen below:
- org.flywaydb:flyway-database-db2
- org.flywaydb:flyway-database-derby
- org.flywaydb:flyway-database-hsqldb
- org.flywaydb:flyway-database-informix
- org.flywaydb:flyway-database-postgresql
- org.flywaydb:flyway-database-oracle
- org.flywaydb:flyway-database-redshift
- org.flywaydb:flyway-database-saphana
- org.flywaydb:flyway-database-snowflake
- org.flywaydb:flyway-database-sybasease
- org.flywaydb:flyway-firebird
- org.flywaydb:flyway-gcp-bigquery
- org.flywaydb:flyway-gcp-spanner
- org.flywaydb:flyway-mysql
- org.flywaydb:flyway-singlestore
- org.flywaydb:flyway-sqlserver
If you are using any of the databases affected, please include the corresponding dependency in your project.
We are expecting that by structuring Flyway in to purposeful dependencies that we can both give developers more control of what aspects of Flyway they include in their project but also allow us to more fluently accept contributions and desired functionality from our community.
For more information on our on going goal to improve Flywayās open source version please see the following blog.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 58
- Comments: 20 (2 by maintainers)
Commits related to this issue
- Pin flyway to 9. versions 10.0 seems to have introduced breaking changes. See https://github.com/flyway/flyway/issues/3780 — committed to codeforamerica/form-flow by vrajmohan 3 years ago
- Pin flyway to 9. versions 10.0 seems to have introduced breaking changes. See https://github.com/flyway/flyway/issues/3780 — committed to codeforamerica/form-flow by vrajmohan 3 years ago
- Pin flyway to 9. versions 10.0 seems to have introduced breaking changes. See https://github.com/flyway/flyway/issues/3780 — committed to codeforamerica/form-flow by vrajmohan 3 years ago
- Add org.flywaydb:flyway-database-postgresql dependency Per https://github.com/flyway/flyway/issues/3780 v10 of Flyway split out into modules. We already have the mysql module, but when the database w... — committed to lazyguru/sublinks-api by lazyguru 2 years ago
- Update flyway.adoc Updated flyway documentation according to issue https://github.com/flyway/flyway/issues/3780 — committed to joaodsimoes/quarkus by joaodsimoes 2 years ago
- Update flyway.adoc Updated flyway documentation according to issue https://github.com/flyway/flyway/issues/3780 (cherry picked from commit bad999b2f068bc593d2b76edf4f5508e797892e6) — committed to gsmet/quarkus by joaodsimoes 2 years ago
- Update flyway.adoc Updated flyway documentation according to issue https://github.com/flyway/flyway/issues/3780 — committed to holly-cummins/quarkus by joaodsimoes 2 years ago
- chore: subindo versĆ£o do spring-boot e adicionando package do flyway para postgres - Após subir a versĆ£o do spring o flyway acusava erro: Unsupported Database: PostgreSQL 16.2 - Isso ocorreu porque n... — committed to WillCQ97/scpods-backend by WillCQ97 2 years ago
- Update flyway.adoc Updated flyway documentation according to issue https://github.com/flyway/flyway/issues/3780 — committed to danielsoro/quarkus by joaodsimoes 2 years ago
- Add postgress docker compose examples + Flyway Modularity Support * added postgress docker compose examples + move mysql flyway into server (remove from hawkbit-repository-jpa-flyway) + in starters i... — committed to bosch-io/hawkbit by avgustinmm 2 years ago
- Add postgress docker compose examples + Flyway Modularity Support * added postgress docker compose examples * move mysql flyway into server (remove from hawkbit-repository-jpa-flyway) * in starters i... — committed to bosch-io/hawkbit by avgustinmm 2 years ago
- Add postgress docker compose examples + Flyway Modularity Support (#2089) * added postgress docker compose examples * move mysql flyway into server (remove from hawkbit-repository-jpa-flyway) * in ... — committed to eclipse-hawkbit/hawkbit by avgustinmm 2 years ago
- Update to latest springboot version. Added the artifact flyway-database-postgresql (https://github.com/flyway/flyway/issues/3780) Added dependency org.apache.commons.commons-compress (https://github.c... — committed to marcusfromsweden/plant-doctor by marcusfromsweden 2 years ago
- Revert "Update to latest springboot version. Added the artifact flyway-database-postgresql (https://github.com/flyway/flyway/issues/3780)" This reverts commit 64004d80b3ae3f66a4321fc7313cc3434a32606f... — committed to marcusfromsweden/plant-doctor by marcusfromsweden 2 years ago
- Update to latest springboot version. Added the artifact flyway-database-postgresql (flyway/flyway#3780) Added dependency org.apache.commons.commons-compress (testcontainers/testcontainers-java#8338) S... — committed to marcusfromsweden/plant-doctor by marcusfromsweden 2 years ago
- [WIP] Fix Flyway issues using older version — committed to cat-wates/stardew-calculator by cat-wates a year ago
I am still getting this error even after adding in the org.flywaydb:flyway-database-postgresql dependency. Please help:
build.gradle
Changing this in my
build.gradlehas fixed theUnsupported Databaseerror for me:Hello, adding the dependencies to
flyway-mysqlandflyway-database-postgresqldid not solve the issue in our case.Weāre running Flyway in an AWS Lambda using a JAR created with the maven shade plugin. All the dependencies are in the pom.xml as below (weāre using version 10.11.1). The database type are present when the lambda is running (we can log their class name). Despite all of this, we keep getting
No database found to handle jdbc:postgresql:and the MySQL equivalent.Is there something specific to do for Lambdas?
For gradle, you need to follow the documentation. š
The dependency MUST be added inside the buildscript. Example for postgresql:
Thank you for preemptively opening this issue. I was about to open issue myself when I saw it š
I have been struggling all weekend to get Flyway to run/work. I have setup an initial Spring Boot (3.3.3) java (17) application. Initially I was using postgres. But despite using both org.flywaydb:flyway-core and flyway-database-postgresql (10.17.2) my migration did not run. When running āgradlew flywayInfoā I get this message.
Then today, I gave up and changed to mysql instead. But I got the same problem. Frustrating.
For Flyway versions higher than 10 with Maven Shade, <transformerimplementation=āorg.apache.maven.plugins.shade.resource.ServicesResourceTransformerā/> is needed because it uses Service Loader and no longer Java reflection. From my Stack Overflow question and answer
It could be cool to update the documentation for common used database (
postgresql,mysqlā¦) and with common build tools (gradle,maven), because the current documentation is still on 9.19 š .In my specific case, Iāve tried for
gradlebuild tool, but without success in my module.I tried to add
implementation("org.flywaydb:flyway-database-postgresql:10.0.0")in the dependencies block, but with the same error/result when I run:flywayMigratetaskAdditionally, I would like to have this dependency ONLY during task execution. Except if Iām wrong, the
flywayplugin doesnāt have a custom dep definition (like thejooqplugin in my example), it means to me Iāll have to carry this dependency in my application⦠even if I donāt use it !? š¤.Created a small spring app from spring
Canāt make it work. Also, tried @Lob2018 SO suggestion but I receive some main error
What I am missing?
https://docs.spring.io/spring-boot/how-to/data-initialization.html#howto.data-initialization.migration-tool.flyway
https://documentation.red-gate.com/flyway/getting-started-with-flyway/system-requirements/supported-databases-and-versions
Caused by: org.flywaydb.core.api.FlywayException: Unsupported Database: PostgreSQL 16.0
properties
POM
EDIT:
By defining explicity jar version, it worked (was not working even with postgres 15.8)
@davinkevin thank you for your suggestion, that is something we may look into
I confirm it worked for me, but itās not a very good pattern for
gradlebuild tool. By doing that, all flyway dependencies leak to the build classpath, for all plugins.The best solution would be to declare a dedicated configuration used by the plugin and which can be declared by a dedicated element in the
dependenciesblock, like done by thejooqplugin.It could be like this for
flyway, which is better for configuration and good to avoid conflicts between plugin dependencies.Thanks for calling this out! Not sure how I missed it š¤¦
@davinkevin this may solve your issue as well. In our case I had to add parens to the snippet as seen below:
This also seems broken for us
The appropriate dependency has been added:
I noticed this in the release notes:
Am I correct in assuming we are waiting for the gradle plugin to be released?