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


Java Flyway.setSchemas方法代碼示例

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


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

示例1: migrateFlyway

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
@PostConstruct
public void migrateFlyway() {
    Flyway flyway = new Flyway();

    if (this.nakadiProducerFlywayDataSource != null) {
        flyway.setDataSource(nakadiProducerFlywayDataSource);
    } else if (this.flywayProperties.isCreateDataSource()) {
        flyway.setDataSource(this.flywayProperties.getUrl(), this.flywayProperties.getUser(),
            this.flywayProperties.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 (callback != null) {
        flyway.setCallbacks(callback);
    }
    flyway.setBaselineOnMigrate(true);
    flyway.setBaselineVersionAsString("2133546886.1.0");
    flyway.migrate();
}
 
開發者ID:zalando-nakadi,項目名稱:nakadi-producer-spring-boot-starter,代碼行數:26,代碼來源:FlywayMigrator.java

示例2: updateDatabase

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
@PostConstruct
public void updateDatabase() throws IOException {
    try {
        Flyway flyway = new Flyway();
        flyway.setEncoding("UTF-8");
        flyway.setTable("flyway_schema");
        flyway.setLocations("db/migration");
        flyway.setSchemas(env.getProperty(PropertyNames.jdbcUser));
        flyway.setDataSource(
                env.getProperty(PropertyNames.jdbcURL),
                env.getProperty(PropertyNames.flywayUser),
                env.getProperty(PropertyNames.flywayPassword));

        flyway.setBaselineOnMigrate(true);
        flyway.migrate();
    } catch (Exception e) {
        log.error("FAILED TO MIGRATE DATABASE", e);
    }
}
 
開發者ID:solita,項目名稱:kansalaisaloite,代碼行數:20,代碼來源:JdbcConfiguration.java

示例3: updateDatabase

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
@PostConstruct
public void updateDatabase() throws IOException {
    Flyway flyway = new Flyway();
    flyway.setEncoding("UTF-8");
    flyway.setTable("flyway_schema");
    flyway.setLocations("testmigration");
    flyway.setSchemas(env.getProperty(PropertyNames.jdbcUser));
    flyway.setDataSource(
            env.getProperty(PropertyNames.jdbcURL),
            env.getProperty(PropertyNames.flywayUser),
            env.getProperty(PropertyNames.flywayPassword));

    flyway.setBaselineOnMigrate(true);
    flyway.migrate();

}
 
開發者ID:solita,項目名稱:kansalaisaloite,代碼行數:17,代碼來源:IntegrationTestConfiguration.java

示例4: flyway1

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

示例5: flyway2

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

示例6: 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

示例7: flywayMigrate

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
static void flywayMigrate(String jdbcUrl) throws SQLException {
  Flyway flyway = new Flyway();
  flyway.setDataSource(jdbcUrl, XStreamTestConstants.USERNAME, XStreamTestConstants.PASSWORD);
  flyway.setSchemas("CDC_TESTING");
  flyway.setLocations("db/migration/common", "db/migration/oracle11g");
  flyway.migrate();
}
 
開發者ID:jcustenborder,項目名稱:kafka-connect-cdc-oracle,代碼行數:8,代碼來源:Oracle11gTest.java

示例8: flywayMigrate

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
static void flywayMigrate(String jdbcUrl, String... locations) throws SQLException {
  Flyway flyway = new Flyway();
  flyway.setDataSource(jdbcUrl, XStreamTestConstants.USERNAME, XStreamTestConstants.PASSWORD);
  flyway.setSchemas("DATATYPE_TESTING");
  flyway.setLocations(locations);
  flyway.migrate();
}
 
開發者ID:jcustenborder,項目名稱:kafka-connect-cdc-oracle,代碼行數:8,代碼來源:Oracle12cTest.java

示例9: migrate

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
public void migrate() {
    Flyway flyway = new Flyway();
    flyway.setDataSource(dbInfo.getDbUrl(), dbInfo.getUser(), dbInfo.getPassword());
    flyway.setSchemas(FLYWAY_TEST);
    flyway.setLocations(Migrator.class.getPackage().getName() + "/migrations");
    flyway.setCallbacks(callbacks);
    flyway.migrate();
}
 
開發者ID:cluelessjoe,項目名稱:jooq-flyway-typesafe-migration,代碼行數:9,代碼來源:Migrator.java

示例10: updateSchema

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
@Inject
public void updateSchema() {
    Flyway flyway = new Flyway();
    flyway.setDataSource(this.dataSource);
    flyway.setSchemas(this.flywaySchemas);
    String[] parts = this.flywayLocations.split(";");
    flyway.setLocations(parts);
    flyway.migrate();
}
 
開發者ID:Nike-Inc,項目名稱:cerberus-management-service,代碼行數:10,代碼來源:SchemaMigrator.java

示例11: before

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
@Override
protected void before() {
    for (TestRegister register : registers) {
        FlywayFactory flywayFactory = getFlywayFactory(register.name());
        Flyway flyway = flywayFactory.build(getDataSource(register.getDatabaseConnectionString("MigrateDatabaseRule")));
        flyway.setSchemas(register.getSchema());
        flyway.migrate();
    }
}
 
開發者ID:openregister,項目名稱:openregister-java,代碼行數:10,代碼來源:MigrateDatabaseRule.java

示例12: migrateH2Database

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
private static void migrateH2Database(DataSource h2DataSource, Map<String, String> propertyPlaceHolders) {
    logger.info("Migrating exomiser H2 database...");
    Flyway h2Flyway = new Flyway();
    h2Flyway.setDataSource(h2DataSource);
    h2Flyway.setSchemas("EXOMISER");
    h2Flyway.setLocations("migration/common", "migration/h2");
    h2Flyway.setPlaceholders(propertyPlaceHolders);
    h2Flyway.clean();
    h2Flyway.migrate();
}
 
開發者ID:exomiser,項目名稱:Exomiser,代碼行數:11,代碼來源:Main.java

示例13: 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

示例14: runMigrations

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
private void runMigrations(String database, String username, String password) {
  Flyway flyway = new Flyway();
  flyway.setDataSource(database, username, password);
  flyway.setSchemas("mc_db");
  flyway.migrate();
}
 
開發者ID:Skelril,項目名稱:Skree,代碼行數:7,代碼來源:DatabaseSystem.java


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