Open overheadhunter opened 1 year ago
For the record, when setting %dev.quarkus.flyway.ignore-missing-migrations=true
, hot reloading works again. But the logs confirm, that V2 is indeed not found:
These are migrations on first start:
2023-07-13 14:55:45,416 INFO [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Current version of schema "public": << Empty Schema >>
2023-07-13 14:55:45,430 INFO [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Migrating schema "public" to version "1 - Create Tables"
2023-07-13 14:55:45,499 INFO [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Migrating schema "public" to version "2 - Initialize Settings"
2023-07-13 14:55:45,537 INFO [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Migrating schema "public" to version "3 - Initialize Settings"
2023-07-13 14:55:45,577 INFO [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Migrating schema "public" to version "4 - Update PKs"
2023-07-13 14:55:45,676 INFO [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Migrating schema "public" to version "5 - UTC Timestamps"
...
and after hot reloading, V2 is simply missing:
2023-07-13 14:56:44,857 INFO [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Current version of schema "public": << Empty Schema >>
2023-07-13 14:56:44,872 INFO [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Migrating schema "public" to version "1 - Create Tables"
2023-07-13 14:56:44,966 INFO [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Migrating schema "public" to version "3 - Initialize Settings"
2023-07-13 14:56:45,010 INFO [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Migrating schema "public" to version "4 - Update PKs"
2023-07-13 14:56:45,130 INFO [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Migrating schema "public" to version "5 - UTC Timestamps"
...
After adding a baseline migration (B14), this workaround might have become obsolete.
Please agree to the following
Summary
Hot Reloading fails due to missing V2 migration
System Setup
Steps to Reproduce
mvn quarkus:dev
localhost:8080
, triggering the initial set of Flyway migrationslocalhost:8080
, triggering a Quarkus reloadExpected Behavior
Flyway validates the database successfully (no migration required)
Actual Behavior
Flyway fails to validate the database:
Detected applied migration not resolved locally: 2.
Reproducibility
Always
Relevant Log Output
Anything else?
The V2 migration is our deprecated Java-based migration (
V2__Initialize_Settings.java
). Other than the SQL-based migrations, this seems to be invisible during a hot reload.Related to #183 and #184
This is our config:
https://github.com/cryptomator/hub/blob/72150eaba3ee6812e1218b1974eb31ee040f902f/backend/src/main/resources/application.properties#L62-L63