本文整理汇总了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();
}
示例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);
}
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
}
示例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();
}
示例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;
}
示例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();
}