org.springframework.boot.autoconfigure.flyway.FlywayMigrationStrategy源码实例Demo

类org.springframework.boot.autoconfigure.flyway.FlywayMigrationStrategy源码实例Demo

下面列出了org.springframework.boot.autoconfigure.flyway.FlywayMigrationStrategy 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: mojito   文件: FlyWayConfig.java
@Bean
public FlywayMigrationStrategy cleanMigrateStrategy() {

    FlywayMigrationStrategy strategy = new FlywayMigrationStrategy() {

        @Override
        public void migrate(Flyway flyway) {

            if (clean) {
                logger.info("Clean DB with Flyway");
                flyway.clean();
            } else {
                logger.info("Don't clean DB with Flyway");
            }

            flyway.migrate();
        }
    };

    return strategy;
}
 
源代码2 项目: find   文件: IdolFindMockConfigConfiguration.java
@Bean
@Primary
public FlywayMigrationStrategy flywayMigrationStrategy() {
    return flyway -> {
        // terrible hack - using system properties to pass data to migration
        System.setProperty(AbstractMigrateUsersToIncludeUsernames.COMMUNITY_PROTOCOL, "HTTP");
        System.setProperty(AbstractMigrateUsersToIncludeUsernames.COMMUNITY_HOST, getProperty(COMMUNITY_HOST_PROPERTY, COMMUNITY_HOST));
        System.setProperty(AbstractMigrateUsersToIncludeUsernames.COMMUNITY_PORT, getProperty(COMMUNITY_PORT_PROPERTY, String.valueOf(COMMUNITY_PORT)));

        flyway.migrate();

        System.clearProperty(AbstractMigrateUsersToIncludeUsernames.COMMUNITY_PROTOCOL);
        System.clearProperty(AbstractMigrateUsersToIncludeUsernames.COMMUNITY_HOST);
        System.clearProperty(AbstractMigrateUsersToIncludeUsernames.COMMUNITY_PORT);
    };
}
 
源代码3 项目: sbp   文件: FlywayClassLoaderConfiguration.java
@Bean
@ConditionalOnMissingBean
public FlywayMigrationStrategy migrationStrategy() {
    return flyway -> {
        FluentConfiguration alterConf = Flyway.configure(plugin.getWrapper().getPluginClassLoader());
        alterConf.configuration(flyway.getConfiguration());
        new Flyway(alterConf).migrate();
    };
}
 
源代码4 项目: syndesis   文件: RepositoryConfiguration.java
@Bean
public FlywayMigrationStrategy repairStrategy() {
    return flyway -> {
        flyway.repair();
        flyway.migrate();
    };
}
 
源代码5 项目: sbp   文件: CleanSchemaConfiguration.java
@Bean
@ConditionalOnProperty(prefix = "spring.flyway", name = "clean-before-migrate")
public FlywayMigrationStrategy migrationStrategy() {
    return new FlywaySchemaCleaner(plugin);
}
 
源代码6 项目: tutorials   文件: EmptyMigrationStrategyConfig.java
@Bean
public FlywayMigrationStrategy flywayMigrationStrategy() {
    return flyway -> {
        log.info("Skipping Flyway migration!");
    };
}
 
源代码评论
动弹
沙发等你来抢
 类方法
 同包方法