org.flywaydb.core.Flyway.getBaselineVersion()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中org.flywaydb.core.Flyway.getBaselineVersion()方法的一些代码示例,展示了Flyway.getBaselineVersion()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Flyway.getBaselineVersion()方法的具体详情如下:
包路径:org.flywaydb.core.Flyway
类名称:Flyway
方法名:getBaselineVersion

Flyway.getBaselineVersion介绍

暂无

代码示例

代码示例来源:origin: org.seedstack.addons.flyway/flyway

private void automaticMigration(Flyway flyway, String dataSourceName, DataSourceConfig dataSourceConf) {
  if (!locationExists(flyway)) {
    // no migration if no script is present
    LOGGER.info("Ignoring Flyway migration for datasource without scripts {}", dataSourceName);
    return;
  }
  if (dataSourceConf != null) {
    if (!dataSourceConf.isEnabled()) {
      // no migration if explicitly disabled
      LOGGER.info("Flyway migration is disabled for datasource {}", dataSourceName);
      return;
    }
    if (!Strings.isNullOrEmpty(dataSourceConf.getOptions().getBaselineVersion())) {
      LOGGER.info("Baselining datasource {} to {}", dataSourceName, flyway.getBaselineVersion());
      flyway.baseline();
    }
  }
  LOGGER.info("Migrating datasource {} to {}", dataSourceName, flyway.getTarget());
  flyway.migrate();
}

代码示例来源:origin: org.seedstack.addons.flyway/flyway

@Override
  public Integer call() throws Exception {
    Flyway flyway = getFlyway();
    if (this.baselineVersion != null) {
      flyway.setBaselineVersionAsString(this.baselineVersion);
    }
    if (this.baselineDescription != null) {
      flyway.setBaselineDescription(this.baselineDescription);
    }

    System.out.println("Flyway: baselining datasource " + getDatasource() + " to " + flyway.getBaselineVersion());
    flyway.baseline();
    return 0;
  }
}

代码示例来源:origin: org.amv.trafficsoft.datahub/xfcd-consumer-jdbc-spring-boot-starter

private void startSchemaMigration() {
    final Flyway flyway = new Flyway();
    flyway.setDataSource(jdbcConsumerHikariDataSource());
    flyway.setLocations(properties.getFlywayScriptsLocation());
    log.info("Starting Trafficsoft Delivery schema migration v{}", flyway.getBaselineVersion().getVersion());
    flyway.migrate();
  }
}

代码示例来源:origin: mbok/logsniffer

logger.debug("Migrating database, base version is: {}", flyway.getBaselineVersion());
flyway.migrate();
logger.debug("Database migrated from base version: {}", flyway.getBaselineVersion());

相关文章