Search in sources :

Example 1 with DatabaseUpgradeSupport

use of org.mifos.db.upgrade.DatabaseUpgradeSupport in project head by mifos.

the class DatabaseInitFilter method init.

@Override
public synchronized void init(FilterConfig filterConfig) {
    try {
        DatabaseUpgradeSupport databaseUpgradeSupport = ServletUtils.getBean(filterConfig.getServletContext(), BEAN_NAME);
        DbUpgradeValidationResult validationResult = databaseUpgradeSupport.validate();
        databaseVerified = validationResult.allUpgradesApplied();
        if (!databaseVerified) {
            ApplicationInitializer.setDatabaseError(DatabaseErrorCode.UPGRADE_FAILURE, "There are un applied db upgrades: ", new RuntimeException(validationResult.getUnAppliedChangeSets()));
        }
    } catch (Exception e) {
        filterConfig.getServletContext().log("Failed to check for unapplied upgrades upgrades", e);
    }
}
Also used : DbUpgradeValidationResult(org.mifos.db.upgrade.DbUpgradeValidationResult) DatabaseUpgradeSupport(org.mifos.db.upgrade.DatabaseUpgradeSupport) ServletException(javax.servlet.ServletException) IOException(java.io.IOException)

Example 2 with DatabaseUpgradeSupport

use of org.mifos.db.upgrade.DatabaseUpgradeSupport in project head by mifos.

the class DatabaseMigrator method upgrade.

public void upgrade(ApplicationContext applicationContext) throws Exception {
    DatabaseUpgradeSupport databaseUpgradeSupport = (DatabaseUpgradeSupport) applicationContext.getBean("databaseUpgradeSupport");
    databaseUpgradeSupport.expansion();
}
Also used : DatabaseUpgradeSupport(org.mifos.db.upgrade.DatabaseUpgradeSupport)

Aggregations

DatabaseUpgradeSupport (org.mifos.db.upgrade.DatabaseUpgradeSupport)2 IOException (java.io.IOException)1 ServletException (javax.servlet.ServletException)1 DbUpgradeValidationResult (org.mifos.db.upgrade.DbUpgradeValidationResult)1