Java 类org.springframework.boot.autoconfigure.flyway.FlywayDataSource 实例源码

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