當前位置: 首頁>>代碼示例>>Java>>正文


Java Flyway.setValidateOnMigrate方法代碼示例

本文整理匯總了Java中org.flywaydb.core.Flyway.setValidateOnMigrate方法的典型用法代碼示例。如果您正苦於以下問題:Java Flyway.setValidateOnMigrate方法的具體用法?Java Flyway.setValidateOnMigrate怎麽用?Java Flyway.setValidateOnMigrate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.flywaydb.core.Flyway的用法示例。


在下文中一共展示了Flyway.setValidateOnMigrate方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initFlyway

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
/**
 * Initialise Flyway
 * 
 * @param ds
 */
private void initFlyway(DataSource ds) {
	try {
		logger.info("Database analysis: in progress...");
		Flyway flyway = new Flyway();
		flyway.setDataSource(ds);
		flyway.setCallbacks(new FlywayCallbackMigration());
		flyway.setBaselineOnMigrate(true);
		flyway.setValidateOnMigrate(true);
		flyway.repair();
		flyway.migrate();
		logger.info("Database analysis: finish...");
	} catch (Exception e) {
		logger.error("Database analysis: ERROR", e);
		throw e;
	}
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:22,代碼來源:JpaConfigEcandidat.java

示例2: get

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
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.getClassLoader(), location, shellMigrationPrefix, shellMigrationSeperator, shellMigrationSuffix));
    flyway.setDataSource(conf.getUrl(), conf.getUser(), conf.getPassword(), null);

    return flyway;
}
 
開發者ID:hortonworks,項目名稱:registry,代碼行數:18,代碼來源:ShellFlywayFactory.java

示例3: get

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
public static Flyway get(StorageProviderConfiguration conf, String scriptRootPath) {
    Flyway flyway = new Flyway();

    String location = "filesystem:" + scriptRootPath + File.separator + conf.getDbType();
    flyway.setEncoding(encoding);
    flyway.setTable(metaDataTableName);
    flyway.setSqlMigrationPrefix(sqlMigrationPrefix);
    flyway.setValidateOnMigrate(validateOnMigrate);
    flyway.setOutOfOrder(outOfOrder);
    flyway.setBaselineOnMigrate(baselineOnMigrate);
    flyway.setBaselineVersion(MigrationVersion.fromVersion(baselineVersion));
    flyway.setCleanOnValidationError(cleanOnValidationError);
    flyway.setLocations(location);
    flyway.setDataSource(conf.getUrl(), conf.getUser(), conf.getPassword(), null);

    return flyway;
}
 
開發者ID:hortonworks,項目名稱:registry,代碼行數:18,代碼來源:SchemaFlywayFactory.java

示例4: flyway3

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
@Bean
public Flyway flyway3(DataSource dataSource) {
    Flyway flyway = new Flyway();
    flyway.setDataSource(dataSource);
    flyway.setSchemas("test");
    flyway.setLocations("db/test_migration/appendable");
    flyway.setValidateOnMigrate(false);
    return flyway;
}
 
開發者ID:zonkyio,項目名稱:embedded-database-spring-test,代碼行數:10,代碼來源:MultipleFlywayBeansIntegrationTest.java

示例5: doMigrate

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
/**
 * Requests that migration actually be executed.
 * <br />Yeah... that's it.
 */
public void doMigrate() {
  Flyway flyway = new Flyway();
  flyway.setDataSource(new DataSourceLoader().getDataSource());
  flyway.setValidateOnMigrate(true);
  flyway.setEncoding("UTF-8");

  LOG.info("Executing Flyway migration...");
  long timeStart = System.currentTimeMillis();
  flyway.migrate();

  long duration = System.currentTimeMillis() - timeStart;
  LOG.info(String.format("Flyway migration complete : Duration[%s ms]", duration));
}
 
開發者ID:revof11,項目名稱:java-circleci-postgres,代碼行數:18,代碼來源:FlywayRunner.java

示例6: upgradeDatabase

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
private void upgradeDatabase(DataSource dataSource) {
    LOG.debug("Setaria database init");

    Flyway flyway = new Flyway();
    flyway.setDataSource(dataSource);
    flyway.setValidateOnMigrate(false);
    flyway.migrate();
}
 
開發者ID:kevin70,項目名稱:setaria,代碼行數:9,代碼來源:DatabaseProcessor.java

示例7: migrate

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
public void migrate() {
	// Create the Flyway instance
	Flyway flyway = new Flyway();

	// Point it to the database
	flyway.setDataSource(JDBCconnection.getConnectionString(),
			JDBCconnection.getUser(), JDBCconnection.getPassword());
	flyway.clean(); // limpando os schemas para sempre executar o flyway.
	flyway.setValidateOnMigrate(false);
	flyway.setBaselineOnMigrate(true);
	// Start the migration
	flyway.migrate();

}
 
開發者ID:willmenn,項目名稱:DerbyPOC,代碼行數:15,代碼來源:Flyway3rdParty.java

示例8: doMigration

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
private void doMigration(LavagnaEnvironment env, DataSource dataSource, MigrationVersion version) {
	String sqlDialect = env.getRequiredProperty("datasource.dialect");
	Flyway migration = new Flyway();
	migration.setDataSource(dataSource);
	// FIXME remove the validation = false when the schemas will be stable
	migration.setValidateOnMigrate(false);
	//

	migration.setTarget(version);

	migration.setLocations("io/lavagna/db/" + sqlDialect + "/");
	migration.migrate();
}
 
開發者ID:digitalfondue,項目名稱:lavagna,代碼行數:14,代碼來源:DatabaseMigrator.java

示例9: build

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
public Flyway build(final DataSource dataSource) {
    final String[] fwSchemas = new String[schemas.size()];
    final String[] fwCallbacks = new String[callbacks.size()];
    final String[] fwLocations = new String[locations.size()];
    final String[] fwResolvers = new String[resolvers.size()];

    final Flyway flyway = new Flyway();

    if (null != classLoader) {
        flyway.setClassLoader(classLoader);
    }

    flyway.setDataSource(dataSource);
    flyway.setEncoding(encoding);
    flyway.setTable(metaDataTableName);
    flyway.setSqlMigrationPrefix(sqlMigrationPrefix);
    flyway.setSqlMigrationSeparator(sqlMigrationSeparator);
    flyway.setSqlMigrationSuffix(sqlMigrationSuffix);
    flyway.setSchemas(schemas.toArray(fwSchemas));
    flyway.setCallbacksAsClassNames(callbacks.toArray(fwCallbacks));
    flyway.setPlaceholderPrefix(placeholderPrefix);
    flyway.setPlaceholderSuffix(placeholderSuffix);
    flyway.setPlaceholders(placeholders);
    flyway.setLocations(locations.toArray(fwLocations));
    flyway.setResolversAsClassNames(resolvers.toArray(fwResolvers));
    flyway.setOutOfOrder(outOfOrder);
    flyway.setBaselineDescription(baselineDescription);
    flyway.setBaselineOnMigrate(baselineOnMigrate);
    flyway.setValidateOnMigrate(validateOnMigrate);

    return flyway;
}
 
開發者ID:dropwizard,項目名稱:dropwizard-flyway,代碼行數:33,代碼來源:FlywayFactory.java

示例10: run

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
@Override
public void run(final Namespace namespace, final Flyway flyway) throws Exception {
    flyway.setOutOfOrder(namespace.getBoolean(OUT_OF_ORDER));
    flyway.setValidateOnMigrate(namespace.getBoolean(VALIDATE_ON_MIGRATE));
    flyway.setCleanOnValidationError(namespace.getBoolean(CLEAN_ON_VALIDATION_ERROR));
    flyway.setBaselineOnMigrate(namespace.getBoolean(INIT_ON_MIGRATE));

    final int successfulMigrations = flyway.migrate();
    LOG.debug("{} successful migrations applied", successfulMigrations);
}
 
開發者ID:dropwizard,項目名稱:dropwizard-flyway,代碼行數:11,代碼來源:DbMigrateCommand.java

示例11: migrator

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
@Bean
public Flyway migrator(Environment env, PlatformProvider platform, DataSource dataSource) {
    String sqlDialect = platform.getDialect(env);
    Flyway migration = new Flyway();
    migration.setDataSource(dataSource);

    migration.setValidateOnMigrate(false);
    migration.setTarget(MigrationVersion.LATEST);
    migration.setOutOfOrder(true);

    migration.setLocations("alfio/db/" + sqlDialect + "/");
    migration.migrate();
    return migration;
}
 
開發者ID:alfio-event,項目名稱:alf.io,代碼行數:15,代碼來源:DataSourceConfiguration.java

示例12: initiateDatabaseConnection

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
public static void initiateDatabaseConnection() throws Exception {
    Flyway flyway = new Flyway();
    flyway.setDataSource("jdbc:sqlite:./db.sqlite", null, null);
    flyway.setValidateOnMigrate(false);
   flyway.migrate();
    System.err.println("Getting connection...");
    Class.forName("org.sqlite.JDBC");
    Connection conn = DriverManager.getConnection("jdbc:sqlite:./db.sqlite");
    System.err.println("Creating DSLContext...");
    Registry.wavetactDB = DSL.using(conn, SQLDialect.SQLITE);
}
 
開發者ID:TechCavern,項目名稱:WaveTact,代碼行數:12,代碼來源:LoadUtils.java

示例13: migrate

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
/**
 * <p>migrate.</p>
 *
 * @param desc a {@link java.lang.String} object.
 * @param uuid a {@link java.lang.String} object.
 * @return a {@link ameba.util.Result} object.
 */
@POST
@Path("{uuid}")
public Result migrate(@FormParam("description") String desc,
                      @PathParam("uuid") String uuid) {
    MigrationFeature.checkMigrationId(uuid);
    String generatedDesc = (mode.isDev() ? "dev " : "") + "migrate";
    if (StringUtils.isNotBlank(desc)) {
        generatedDesc = desc;
    }

    Map<String, Migration> migrations = getMigrations();
    for (String dbName : migrations.keySet()) {
        Migration migration = migrations.get(dbName);
        ScriptInfo info = migration.generate();
        info.setDescription(generatedDesc);
        Flyway flyway = locator.getService(Flyway.class, dbName);
        flyway.setBaselineDescription(info.getDescription());
        flyway.setBaselineVersionAsString(info.getRevision());
        flyway.setValidateOnMigrate(false);

        try {
            flyway.migrate();
            migration.persist();
            migration.reset();
        } catch (Throwable err) {
            if (failMigrations == null) {
                synchronized (this) {
                    if (failMigrations == null) {
                        failMigrations = Maps.newHashMap();
                    }
                }
            }
            failMigrations.put(dbName, MigrationFail.create(flyway, err, migration));
        }
    }
    if (failMigrations == null || failMigrations.isEmpty()) {
        return Result.success();
    } else {
        return Result.failure();
    }
}
 
開發者ID:icode,項目名稱:ameba,代碼行數:49,代碼來源:MigrationResource.java


注:本文中的org.flywaydb.core.Flyway.setValidateOnMigrate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。