Package com.googlecode.flyway.core

Examples of com.googlecode.flyway.core.Flyway


    public void upgradeAllTenants() {
  upgradeTenantDB();
        final List<MifosPlatformTenant> tenants = this.tenantDetailsService.findAllTenants();
        for (final MifosPlatformTenant tenant : tenants) {
            if (tenant.isAutoUpdateEnabled()) {
                final Flyway flyway = new Flyway();
                flyway.setDataSource(tenant.databaseURL(), tenant.getSchemaUsername(), tenant.getSchemaPassword());
                flyway.setLocations("sql/migrations/core_db");
                flyway.setOutOfOrder(true);
                try {
      flyway.migrate();
                } catch (FlywayException e) {
          String betterMessage = e.getMessage()
              + "; for Tenant DB URL: " + tenant.databaseURL()
              + ", username: " + tenant.getSchemaUsername();
          throw new FlywayException(betterMessage, e.getCause());
View Full Code Here


  /**
   * Initializes, and if required upgrades (using Flyway) the Tenant DB itself.
   */
  private void upgradeTenantDB() {
    final Flyway flyway = new Flyway();
    flyway.setDataSource(tenantDataSource);
    flyway.setLocations("sql/migrations/list_db");
    flyway.setOutOfOrder(true);
    flyway.migrate();

    tenantDataSourcePortFixService.fixUpTenantsSchemaServerPort();
  }
View Full Code Here

public class DatabaseMigrator {

    private final Flyway flyway;

    public DatabaseMigrator(DataSource dataSource) {
        flyway = new Flyway();
        flyway.setDataSource(dataSource);
        flyway.setSqlMigrationPrefix("");
        silenceLogging();
    }
View Full Code Here

import com.googlecode.flyway.core.Flyway;

public class FlywayDemo1 {
  public static void main(String[] args)
  {
    Flyway flyway = new Flyway();
    flyway.setDataSource(getDataSource());
    flyway.setSchemas("demo1");
    flyway.init();
   
    System.out.println("+++ DEMO END");
  }
View Full Code Here

public class FlywayDemo3
{
  public static void main(String[] args)
  {
    Flyway flyway = new Flyway();
    flyway.setDataSource(getDataSource());
    flyway.setSchemas("demo2");
    flyway.migrate();
   
    System.out.println("+++ DEMO END");
  }
View Full Code Here

public class FlywayDemo4
{
  public static void main(String[] args)
  {
    Flyway flyway = new Flyway();
    flyway.setDataSource(getDataSource());
    flyway.setSchemas("demo3");
    flyway.migrate();
   
    System.out.println("+++ DEMO END");
  }
View Full Code Here

TOP

Related Classes of com.googlecode.flyway.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.