本文整理匯總了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();
}