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

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

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

Flyway.setBaselineVersionAsString介绍

暂无

代码示例

代码示例来源: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: openl-tablets/openl-tablets

flyway.setBaselineVersionAsString("0");
flyway.setBaselineOnMigrate(true);
flyway.setTable("openl_security_flyway");

代码示例来源:origin: kawasima/enkan

@Override
public void start(FlywayMigration component) {
  DataSourceComponent dataSourceComponent = getDependency(DataSourceComponent.class);
  DataSource dataSource = dataSourceComponent.getDataSource();
  component.flyway = new Flyway(Thread.currentThread().getContextClassLoader());
  component.flyway.setTable(table);
  component.flyway.setBaselineOnMigrate(true);
  component.flyway.setBaselineVersionAsString("0");
  component.flyway.setDataSource(dataSource);
  if (component.locations != null) {
    component.flyway.setLocations(component.locations);
  }
  if (isMigrationAvailable()) {
    component.flyway.migrate();
  }
}

代码示例来源:origin: org.openl.rules/org.openl.rules.security.standalone

flyway.setBaselineVersionAsString("0");
flyway.setBaselineOnMigrate(true);
flyway.setTable("openl_security_flyway");

代码示例来源:origin: org.openl.rules/org.openl.security.standalone

flyway.setBaselineVersionAsString("0");
flyway.setBaselineOnMigrate(true);
flyway.setTable("openl_security_flyway");

代码示例来源:origin: org.arquillian.ape/arquillian-ape-sql-standalone-flyway

flyway.setBaselineVersionAsString((String) this.options.get(BASELINE_VERSION));

代码示例来源:origin: org.zalando/nakadi-producer-spring-boot-starter

@PostConstruct
public void migrateFlyway() {
  Flyway flyway = new Flyway();
  if (this.nakadiProducerFlywayDataSource != null) {
    flyway.setDataSource(nakadiProducerFlywayDataSource);
  } else if (this.flywayProperties != null && this.flywayProperties.isCreateDataSource()) {
    flyway.setDataSource(
        Optional.ofNullable(this.flywayProperties.getUrl()).orElse(dataSourceProperties.getUrl()),
        Optional.ofNullable(this.flywayProperties.getUser()).orElse(dataSourceProperties.getUsername()),
        Optional.ofNullable(this.flywayProperties.getPassword()).orElse(dataSourceProperties.getPassword()),
        this.flywayProperties.getInitSqls().toArray(new String[0]));
  } else if (this.flywayDataSource != null) {
    flyway.setDataSource(this.flywayDataSource);
  } else {
    flyway.setDataSource(dataSource);
  }
  flyway.setLocations("classpath:db_nakadiproducer/migrations");
  flyway.setSchemas("nakadi_events");
  if (callbacks != null) {
    flyway.setCallbacks(callbacks.stream().map(FlywayCallbackAdapter::new).toArray(FlywayCallback[]::new));
  }
  flyway.setBaselineOnMigrate(true);
  flyway.setBaselineVersionAsString("2133546886.1.0");
  flyway.migrate();
}

代码示例来源:origin: icode/ameba

Flyway flyway = locator.getService(Flyway.class, dbName);
flyway.setBaselineDescription(info.getDescription());
flyway.setBaselineVersionAsString(info.getRevision());
flyway.setValidateOnMigrate(false);

代码示例来源:origin: DSpace/DSpace

} else {
  flyway.setBaselineVersionAsString(dbVersion);
  flyway.setBaselineDescription("Initializing from DSpace " + dbVersion + " database schema");
  flyway.baseline();

相关文章