Package org.flywaydb.core

Examples of org.flywaydb.core.Flyway


  public void overrideLocations() throws Exception {
    EnvironmentTestUtils.addEnvironment(this.context,
        "flyway.locations:classpath:db/changelog,classpath:db/migration");
    registerAndRefresh(EmbeddedDataSourceConfiguration.class,
        FlywayAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class);
    Flyway flyway = this.context.getBean(Flyway.class);
    assertEquals("[classpath:db/changelog, classpath:db/migration]",
        Arrays.asList(flyway.getLocations()).toString());
  }
View Full Code Here


  @Test
  public void overrideSchemas() throws Exception {
    EnvironmentTestUtils.addEnvironment(this.context, "flyway.schemas:public");
    registerAndRefresh(EmbeddedDataSourceConfiguration.class,
        FlywayAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class);
    Flyway flyway = this.context.getBean(Flyway.class);
    assertEquals("[public]", Arrays.asList(flyway.getSchemas()).toString());
  }
View Full Code Here

  private Map<String, Flyway> flyways() {
    Map<String, Flyway> flywayMap = Maps.newHashMap();
    Map<String, DbSource> dbSourceMap = dbConfig.getAllDbSources();
    DbSource dbSource = null;
    String migrationFilesLocation = null;
    Flyway flyway = null;
    for (String dbName : dbSourceMap.keySet()) {
      migrationFilesLocation = flywayPrefixToMigrationScript + dbName;
//      if (dbConfig.migrationFileDirectoryExists(migrationFilesLocation)) {
      dbSource = dbSourceMap.get(dbName);
      flyway = new Flyway();
      flyway.setDataSource(dbSource.url, dbSource.user, dbSource.password);
      flyway.setLocations(migrationFilesLocation);
      if (dbConfig.isClean(dbName)) {
        flyway.setCleanOnValidationError(true);
      }
      if (dbConfig.initOnMigrate(dbName)) {
        flyway.setInitOnMigrate(true);
      }
      flywayMap.put(dbName, flyway);
//      }
    }
    return flywayMap;
View Full Code Here

TOP

Related Classes of org.flywaydb.core.Flyway

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.