Package com.googlecode.flyway.core

Examples of com.googlecode.flyway.core.Flyway


    return dataSource;
  }

  @Bean
  public Flyway flyway() {
    final Flyway flyway = new Flyway();
    flyway.setInitOnMigrate(true);
    flyway.setDataSource(dataSource());
    String locationsValue = env.getProperty("flyway.migrations.location");
    String[] locations = locationsValue.split("\\s*,\\s*");
    flyway.setLocations(locations);
    flyway.migrate();
    return flyway;
  }
View Full Code Here


  public <T> T getRepository(Class<T> repositoryInterface) {
    return factory.getRepository(repositoryInterface);
  }

  private static void initFlyway(DataSource dataSource) {
    final Flyway flyway = new Flyway();
    flyway.setInitOnMigrate(true);
    flyway.setDataSource(dataSource);
    flyway.setLocations("db/migration/hsqldb");
    flyway.migrate();
  }
View Full Code Here

   */
  public void runFlywayMigration(final String... locations) {
    this.emUtil.doWork(new DsWork() {
      @Override
      public void execute(DataSource ds) {
        Flyway flyway = new Flyway();
        flyway.setDataSource(ds);
        flyway.setLocations(locations);
        flyway.migrate();
      }
    });
  }
View Full Code Here

   */
  public void clearSchema() {
    this.emUtil.doWork(new DsWork() {
      @Override
      public void execute(DataSource ds) {
        Flyway flyway = new Flyway();
        flyway.setDataSource(ds);
        flyway.clean(); // FIXME: Try Liquibase.dropAll()
      }
    });
  }
View Full Code Here

   */
  public void runFlywayMigration(final String... locations) {
    this.connUtil.doWork(new DsWork() {
      @Override
      public void execute(DataSource ds) {
        Flyway flyway = new Flyway();
        flyway.setDataSource(ds);
        flyway.setLocations(locations);
        flyway.migrate();
      }
    });
  }
View Full Code Here

   */
  public void clearSchema() {
    this.connUtil.doWork(new DsWork() {
      @Override
      public void execute(DataSource ds) {
        Flyway flyway = new Flyway();
        flyway.setDataSource(ds);
        flyway.clean(); // FIXME: Try Liquibase.dropAll()
      }
    });
  }
View Full Code Here

            String connectionUsername = ninjaProperties.getOrDie(NinjaConstant.DB_CONNECTION_USERNAME);
            String connectionPassword = ninjaProperties.getOrDie(NinjaConstant.DB_CONNECTION_PASSWORD);
       
            // We migrate automatically => if you do not want that (eg in production)
            // set ninja.migration.run=false in application.conf
            Flyway flyway = new Flyway();
            flyway.setDataSource(connectionUrl, connectionUsername, connectionPassword);
           
            // In testmode we are cleaning the database so that subsequent testcases
            // get a fresh database.
            if (ninjaProperties.isTest()) {
                flyway.clean();
            }
           
            flyway.migrate();
           
        }
       
    }
View Full Code Here

public class FlywayDemo2
{
  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 void runFlywayMigration(final String... locations) {
    this.connUtil.doWork(new DsWork() {
      @Override
      public void execute(DataSource ds) {
        Flyway flyway = new Flyway();
        flyway.setDataSource(ds);
        flyway.setLocations(locations);
        flyway.migrate();
      }
    });
  }
View Full Code Here

   */
  public void clearSchema() {
    this.connUtil.doWork(new DsWork() {
      @Override
      public void execute(DataSource ds) {
        Flyway flyway = new Flyway();
        flyway.setDataSource(ds);
        flyway.clean(); // FIXME: Try Liquibase.dropAll()
      }
    });
  }
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.