Package com.carbonfive.db.migration

Examples of com.carbonfive.db.migration.DriverManagerMigrationManager


        }
    }

    public DriverManagerMigrationManager createMigrationManager()
    {
        DriverManagerMigrationManager manager = new DriverManagerMigrationManager(driver, url, username, password, DatabaseType.valueOf(databaseType));

        String path = migrationsPath;

        if (path.startsWith("file:"))
        {
            path = substring(path, 5);
        }
        if (!path.startsWith("classpath:") && !path.startsWith("\"") && !path.startsWith("/"))
        {
            path = project.getBasedir().getAbsolutePath() + "/" + path;
        }
        path = separatorsToUnix(path);

        manager.setMigrationResolver(new ResourceMigrationResolver(path));

        SimpleVersionStrategy strategy = new SimpleVersionStrategy();
        strategy.setVersionTable(defaultIfEmpty(versionTable, SimpleVersionStrategy.DEFAULT_VERSION_TABLE));
        strategy.setVersionColumn(defaultIfEmpty(versionColumn, SimpleVersionStrategy.DEFAULT_VERSION_COLUMN));
        strategy.setAppliedDateColumn(defaultIfEmpty(appliedDateColumn, SimpleVersionStrategy.DEFAULT_APPLIED_DATE_COLUMN));
        strategy.setDurationColumn(defaultIfEmpty(durationColumn, SimpleVersionStrategy.DEFAULT_DURATION_COLUMN));
        manager.setVersionStrategy(strategy);

        return manager;
    }
View Full Code Here

TOP

Related Classes of com.carbonfive.db.migration.DriverManagerMigrationManager

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.