Closed
Description
I'm trying to configure where/how to find the flyway callbacks using the FlywayConfigurationCustomizer
with something like the following.
configuration.callbacks("db");
On debugging why this was not working I saw that FlywayAutoConfiguration
seems to be overwriting any changes to the list of callbacks that may have been made by a FlywayConfigurationCustomizer
.
Starting with the code here FlywayAutoConfiguration.java#L120 it seems that:
- FlywayAutoConfiguration: auto discovered spring components that implement
Callback
are used to configure flyway. - My customizer: configures the flyway callbacks.
- FlywayAutoConfiguration: replaces list of callbacks with the same list from 1.
Incidentally, it seems to do this by calling two differently named methods that have exactly the same content configureCallbacks
and configureFlywayCallbacks
.
Spring Boot: 2.7.0