当前位置: 首页>>代码示例>>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;未经允许,请勿转载。