mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
liquibase upgrade (#993)
This commit is contained in:
@@ -41,7 +41,7 @@ public class StartupService implements Managed {
|
||||
updateSchema();
|
||||
long count = UnitOfWork.call(sessionFactory, () -> userDAO.count());
|
||||
if (count == 0) {
|
||||
UnitOfWork.run(sessionFactory, () -> initialData());
|
||||
UnitOfWork.run(sessionFactory, this::initialData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,8 +63,9 @@ public class StartupService implements Managed {
|
||||
}
|
||||
|
||||
ResourceAccessor accessor = new ClassLoaderResourceAccessor(Thread.currentThread().getContextClassLoader());
|
||||
Liquibase liq = new Liquibase("migrations.xml", accessor, database);
|
||||
liq.update("prod");
|
||||
try (Liquibase liq = new Liquibase("migrations.xml", accessor, database)) {
|
||||
liq.update("prod");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
|
||||
Reference in New Issue
Block a user