[Bugfix] fixed handlinge of missing migrations directory
This commit is contained in:
parent
c224dc63b6
commit
f43088d680
|
@ -70,6 +70,10 @@ public class MigrationsHandler extends StrolchComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapOfLists<String, Version> queryMigrationsToRun(Certificate cert) {
|
public MapOfLists<String, Version> queryMigrationsToRun(Certificate cert) {
|
||||||
|
if (!this.migrationsPath.isDirectory()) {
|
||||||
|
return new MapOfLists<>();
|
||||||
|
}
|
||||||
|
|
||||||
Map<String, Version> currentVersions = getCurrentVersions(cert);
|
Map<String, Version> currentVersions = getCurrentVersions(cert);
|
||||||
Migrations migrations = new Migrations(getContainer(), currentVersions);
|
Migrations migrations = new Migrations(getContainer(), currentVersions);
|
||||||
migrations.parseMigrations(this.migrationsPath);
|
migrations.parseMigrations(this.migrationsPath);
|
||||||
|
@ -157,6 +161,11 @@ public class MigrationsHandler extends StrolchComponent {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
|
if (!MigrationsHandler.this.migrationsPath.isDirectory()) {
|
||||||
|
logger.info("There are no migrations required at the moment!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
CurrentMigrationVersionQuery query = new CurrentMigrationVersionQuery(getContainer());
|
CurrentMigrationVersionQuery query = new CurrentMigrationVersionQuery(getContainer());
|
||||||
PrivilegeHandler privilegeHandler = getContainer().getComponent(PrivilegeHandler.class);
|
PrivilegeHandler privilegeHandler = getContainer().getComponent(PrivilegeHandler.class);
|
||||||
QueryCurrentVersionsAction queryAction = new QueryCurrentVersionsAction(query);
|
QueryCurrentVersionsAction queryAction = new QueryCurrentVersionsAction(query);
|
||||||
|
|
Loading…
Reference in New Issue