use of ai.elimu.util.db.DbMigrationHelper in project webapp by elimu-ai.
the class CustomDispatcherServlet method initWebApplicationContext.
@Override
protected WebApplicationContext initWebApplicationContext() {
logger.info("initWebApplicationContext");
WebApplicationContext webApplicationContext = super.initWebApplicationContext();
// Database migration
logger.info("Performing database migration...");
new DbMigrationHelper().performDatabaseMigration(webApplicationContext);
if (EnvironmentContextLoaderListener.env == Environment.DEV) {
// To ease development, pre-populate database with educational content extracted from the test server
// Lookup the language of the educational content from the config file
Language language = Language.valueOf(ConfigHelper.getProperty("content.language"));
logger.info("language: " + language);
// Import the educational content
logger.info("Performing database content import...");
new DbContentImportHelper().performDatabaseContentImport(Environment.TEST, language, webApplicationContext);
createJpaSchemaExport();
}
return webApplicationContext;
}
Aggregations