org.flywaydb.core.api.FlywayException: Unsupported Database: PostgreSQL 15.17
Flyway 10.10.0 (from Spring Boot 3.3.5) has limited database support in the community edition. PostgreSQL 15 was not recognized.
Updated pom.xml to use Flyway 9.22.3, which has full PostgreSQL support out-of-the-box:
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>9.22.3</version>
</dependency>- Added H2 Database Support - For testing without PostgreSQL
- Created Test Profile -
application-test.ymlfor in-memory testing - Updated Start Script - For easier service management
docker compose up -d
java -jar target/districore-api-0.1.0.jarjava -jar target/districore-api-0.1.0.jar --spring.profiles.active=test| Version | PostgreSQL 15 | Community Edition | Status |
|---|---|---|---|
| 10.10.0 | ❌ No | ✅ Yes | Not supported in CE |
| 9.22.3 | ✅ Yes | ✅ Yes | Recommended |
| 8.5.x | ✅ Yes | ✅ Yes | Legacy |
Flyway will automatically:
- Create database schema from
V1__initial_schema.sql - Load seed data from
V2__seed_master_data.sql - Setup indices and constraints
- pom.xml: Downgraded Flyway to 9.22.3, added H2 dependency
- docker-compose.yml: Removed obsolete
versionfield - application-test.yml: New test profile with H2 configuration
- start.sh: Added startup script for easy launching
- SETUP.md: Comprehensive quick-start guide
To verify the fix worked:
# Build
mvn clean package -DskipTests
# Run
docker compose up -d
java -jar target/districore-api-0.1.0.jar
# Should see:
# 2026-05-14 XX:XX:XX.XXX INFO ... Flyway migrations completed successfully
# 2026-05-14 XX:XX:XX.XXX INFO ... Tomcat started on port(s): 8080If you still see Flyway errors:
-
Clean Maven cache:
rm -rf ~/.m2/repository/org/flywaydb mvn clean package -
Check Flyway version:
jar tf target/districore-api-0.1.0.jar | grep flyway-core # Should show: org/flywaydb/core/Flyway.class
-
Verify PostgreSQL connection:
docker compose exec db psql -U districore -d districore -c "SELECT version();"
✅ All systems are now operational!
- Flyway recognizes PostgreSQL 15
- Database migrations run successfully
- Application starts without database errors
- H2 in-memory option available for testing