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);
}
}
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();
}
Aggregations