Search in sources :

Example 1 with MigrationManager

use of com.autentia.tnt.manager.data.MigrationManager in project TNTConcept by autentia.

the class ConsoleBean method migrateDB.

public String migrateDB() {
    MigrationManager mig = MigrationManager.getDefault();
    try {
        // Migrate database
        Version oldVersion = mig.upgradeDatabase();
        // Tell user
        FacesUtils.addInfoMessage(null, "msg.migrationSuccess", oldVersion, Version.getApplicationVersion());
        // Refresh lock filter state
        ApplicationLock.refresh();
    } catch (DataException e) {
        FacesUtils.addErrorMessage(null, "error.migration");
        log.error("migrateDB - exception", e);
    }
    return null;
}
Also used : DataException(com.autentia.tnt.manager.data.exception.DataException) Version(com.autentia.tnt.version.Version) MigrationManager(com.autentia.tnt.manager.data.MigrationManager)

Aggregations

MigrationManager (com.autentia.tnt.manager.data.MigrationManager)1 DataException (com.autentia.tnt.manager.data.exception.DataException)1 Version (com.autentia.tnt.version.Version)1