Description
As discussed on gitter with @jnizet :
Hi team. I was just experimenting with native image support with a small application I have, and I think I found a missing piece in the native support. Flyway migrations are correctly detected and run... except the Java migrations. I get the following warning from Flyway at startup:
WARN 1 --- [ main] o.f.core.internal.command.DbMigrate : Schema "public" has a version (011) that is newer than the latest available migration (010) !
And the reason is that the migration 011, which has been run by a previous run of the application (in "non-native" mode), is a Java migration rather than a more traditional SQL migration (https://flywaydb.org/documentation/tutorials/java)
While we support the discovery of static sql migration files at runtime in a native image (using a custom resolver, org.springframework.boot.autoconfigure.flyway.NativeImageResourceProviderCustomizer
) we are currently missing reflection metadata entries for the Java migration classes, since they are instantiated reflectively.