[Bugfix] fixed handlinge of missing migrations directory

This commit is contained in:
Robert von Burg 2015-02-09 00:40:28 +01:00
parent c224dc63b6
commit f43088d680
1 changed files with 9 additions and 0 deletions

View File

@ -70,6 +70,10 @@ public class MigrationsHandler extends StrolchComponent {
}
public MapOfLists<String, Version> queryMigrationsToRun(Certificate cert) {
if (!this.migrationsPath.isDirectory()) {
return new MapOfLists<>();
}
Map<String, Version> currentVersions = getCurrentVersions(cert);
Migrations migrations = new Migrations(getContainer(), currentVersions);
migrations.parseMigrations(this.migrationsPath);
@ -157,6 +161,11 @@ public class MigrationsHandler extends StrolchComponent {
@Override
public void run() {
if (!MigrationsHandler.this.migrationsPath.isDirectory()) {
logger.info("There are no migrations required at the moment!");
return;
}
CurrentMigrationVersionQuery query = new CurrentMigrationVersionQuery(getContainer());
PrivilegeHandler privilegeHandler = getContainer().getComponent(PrivilegeHandler.class);
QueryCurrentVersionsAction queryAction = new QueryCurrentVersionsAction(query);