@Bean(initMethod = "migrate") @FlywayDataSource @Primary public Flyway primaryFlyway(FlywayPrimaryProperties properties) { Flyway flyway = new Flyway(); flyway.setDataSource(primaryDataSource); flyway.setLocations(properties.getLocation()); return flyway; }
@Bean(initMethod = "migrate") @FlywayDataSource public Flyway secondaryFlyway(FlywaySecondaryProperties properties) { Flyway flyway = new Flyway(); flyway.setDataSource(secondaryDataSource); flyway.setLocations(properties.getLocation()); return flyway; }
@Bean @ConfigurationProperties(prefix="flyway.datasource") @FlywayDataSource public DataSource secondaryDataSource() { return DataSourceBuilder.create().build(); }