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

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

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

Flyway.setResolvers介绍

暂无

代码示例

代码示例来源:origin: ch.inftec.flyway/flyway-extension-core

public static void configure(Flyway flyway, Properties properties) throws SQLException {
    flyway.setCallbacks(new BeforeAfterCallback(properties), new RepeatableCallback(flyway));
    List<MigrationResolver> migrationResolvers = new ArrayList<>();
    for (String locationDescriptor : flyway.getLocations()) {
      migrationResolvers.add(new RepeatableMigrationResolver(flyway, "R", new Location(locationDescriptor)));
    }

    flyway.setResolvers(migrationResolvers.toArray(new MigrationResolver[0]));
  }
}

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

flyway.setResolvers((MigrationResolver[]) this.options.get(RESOLVERS));

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

Migration migration = locator.getService(Migration.class, dbName);
  migrations.add(migration);
  flyway.setResolvers(new DatabaseMigrationResolver(migration));
});

代码示例来源:origin: org.spincast/spincast-plugins-flyway-utils

protected Flyway createFlyway() {
  Flyway flyway = new Flyway();
  flyway.setDataSource(getDataSource());
  String schema = getSchema();
  if (schema != null) {
    flyway.setSchemas(schema);
  }
  flyway.setResolvers(SpincastFlywayMigrationContextDefault.this);
  flyway.setSkipDefaultResolvers(true);
  flyway.setSkipDefaultCallbacks(true);
  return flyway;
}

代码示例来源:origin: org.leapframework/jmms-engine

protected Flyway createFlyway(OrmContext oc) {
  Set<String> locations = new LinkedHashSet<>();
  for(Resource dir : cfg.getDirs(cfg.getMigrationName())){
    if(null != dir && dir.exists()) {
      if (dir.hasClasspath()) {
        locations.add(dir.getClasspath());
      } else {
        locations.add("filesystem:" + dir.getFilepath());
      }
    }
  }
  Resource cp = Resources.getResource("classpath:db/migration/");
  if(cp.exists()) {
    locations.add("db/migration");
  }
  if(locations.isEmpty()) {
    return null;
  }
  Flyway flyway = new Flyway();
  flyway.setResolvers();
  flyway.setBaselineVersion(MigrationVersion.fromVersion("0"));
  flyway.setCallbacks(new FlywayMigrateCallback());
  flyway.setLocations(locations.toArray(new String[0]));
  flyway.setDataSource(oc.getDataSource());
  flyway.setValidateOnMigrate(false);
  return flyway;
}

代码示例来源:origin: com.hortonworks.registries/storage-tool

public static Flyway get(StorageProviderConfiguration conf, String scriptRootPath) {
  Flyway flyway = new Flyway();
  String location = "filesystem:" + scriptRootPath;
  flyway.setEncoding(encoding);
  flyway.setTable(metaDataTableName);
  flyway.setValidateOnMigrate(validateOnMigrate);
  flyway.setOutOfOrder(outOfOrder);
  flyway.setBaselineOnMigrate(baselineOnMigrate);
  flyway.setBaselineVersion(MigrationVersion.fromVersion(baselineVersion));
  flyway.setCleanOnValidationError(cleanOnValidationError);
  flyway.setLocations(location);
  flyway.setResolvers(new ShellMigrationResolver(flyway.getConfiguration(), location, shellMigrationPrefix, shellMigrationSeperator, shellMigrationSuffix));
  flyway.setDataSource(conf.getUrl(), conf.getUser(), conf.getPassword(), null);
  return flyway;
}

代码示例来源:origin: hortonworks/registry

public static Flyway get(StorageProviderConfiguration conf, String scriptRootPath) {
  Flyway flyway = new Flyway();
  String location = "filesystem:" + scriptRootPath;
  flyway.setEncoding(encoding);
  flyway.setTable(metaDataTableName);
  flyway.setValidateOnMigrate(validateOnMigrate);
  flyway.setOutOfOrder(outOfOrder);
  flyway.setBaselineOnMigrate(baselineOnMigrate);
  flyway.setBaselineVersion(MigrationVersion.fromVersion(baselineVersion));
  flyway.setCleanOnValidationError(cleanOnValidationError);
  flyway.setLocations(location);
  flyway.setResolvers(new ShellMigrationResolver(flyway.getConfiguration(), location, shellMigrationPrefix, shellMigrationSeperator, shellMigrationSuffix));
  flyway.setDataSource(conf.getUrl(), conf.getUser(), conf.getPassword(), null);
  return flyway;
}

相关文章