Need help with Spring/Flyway configuration. Spring boot Kotlin app has 2 datasources:
@Primary
@Bean("dataSource")
fun dataSource(): DataSource {
return DataSourceBuilder
.create()
.build()
}
@Bean("legacyDataSource")
fun legacyDataSource(): DataSource {
val dataSource = OracleDataSource()
// todo: configure
return dataSource
}
I would like to use Flyway only for dataSource, not for legacyDataSource. Usually Flyway should injects flywayInitializer only for the primary bean, but sometimes it could apply also for legacyDataSource (eg. when dataSource is disabled in current profile). Does Flyway has an option to disable it per datasource bean? Hints for keys in application.properties would be very nice ;)