Package org.javalite.db_migrator

Examples of org.javalite.db_migrator.MigrationManager


public class ValidateMojo extends AbstractMigrationMojo {
    public void executeMojo() throws MojoExecutionException {
        getLog().info("Validating " + getUrl() + " using migrations at " + getMigrationsPath());
        try {
            Base.open(getDriver(), getUrl(), getUsername(), getPassword());
            MigrationManager manager = new MigrationManager(getMigrationsPath());
            List<Migration> pendingMigrations = manager.getPendingMigrations();

            getLog().info("Database: " + getUrl());
            getLog().info("Up-to-date: " + pendingMigrations.isEmpty());
            if (!pendingMigrations.isEmpty()) {
                getLog().info("Pending Migrations: ");
View Full Code Here


    public void executeMojo() throws MojoExecutionException {
        getLog().info("Migrating " + getUrl() + " using migrations at " + getMigrationsPath());
        try{
            Base.open(getDriver(), getUrl(), getUsername(), getPassword());
            new MigrationManager(getMigrationsPath()).migrate(getLog(), getEncoding());
        }catch(Exception e){
            throw new MojoExecutionException("Failed to migrate database " + getUrl(), e);
        }
        finally {
            Base.close(true);
View Full Code Here

        getLog().info("Checking " + getUrl() + " using migrations at " + getMigrationsPath());

        List<Migration> pendingMigrations;
        try {
            Base.open(getDriver(), getUrl(), getUsername(), getPassword());
            MigrationManager manager = new MigrationManager(getMigrationsPath());
            pendingMigrations = manager.getPendingMigrations();
        } catch (Exception e) {
            throw new MojoExecutionException("Failed to check " + getUrl(), e);
        }finally {
            Base.close(true);
        }
View Full Code Here

        } catch (Exception e) {/*ignore*/}
        Base.exec("create database mysql_migration_test");
        Base.close();

        Base.open("com.mysql.jdbc.Driver", "jdbc:mysql://localhost/mysql_migration_test", "root", "p@ssw0rd");
        migrationManager = new MigrationManager("src/test/resources/test_migrations/mysql/");
    }
View Full Code Here

    private MigrationManager migrationManager;

    @Before
    public void setup() throws Exception {
        Base.open("org.h2.Driver", "jdbc:h2:mem:h2-migration-test;DB_CLOSE_DELAY=-1", "sa", "");
        migrationManager = new MigrationManager("src/test/resources/test_migrations/h2/");
    }
View Full Code Here


    @Before
    public void setup() throws Exception {
        Base.open("org.hsqldb.jdbcDriver", "jdbc:hsqldb:file:./target/tmp/hsql-migration-test", "sa", "");
        migrationManager = new MigrationManager("src/test/resources/test_migrations/hsql/");
    }
View Full Code Here

TOP

Related Classes of org.javalite.db_migrator.MigrationManager

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.