diff options
author | Anton Tananaev <anton@traccar.org> | 2024-04-17 07:47:01 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2024-04-17 07:47:01 -0700 |
commit | ef67a4c1577b2fbabb04c4de9b08b6d778c78952 (patch) | |
tree | ce0670aa9e74c52602b842546ced9649f2c73f86 /src/main/java/org/traccar/storage | |
parent | 8458c3f3cbf6a42fde3d455c9c231498ca0fa184 (diff) | |
download | trackermap-server-ef67a4c1577b2fbabb04c4de9b08b6d778c78952.tar.gz trackermap-server-ef67a4c1577b2fbabb04c4de9b08b6d778c78952.tar.bz2 trackermap-server-ef67a4c1577b2fbabb04c4de9b08b6d778c78952.zip |
Move some defaults to the code
Diffstat (limited to 'src/main/java/org/traccar/storage')
-rw-r--r-- | src/main/java/org/traccar/storage/DatabaseModule.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/storage/DatabaseModule.java b/src/main/java/org/traccar/storage/DatabaseModule.java index 9d9e5bd5e..9898a2fca 100644 --- a/src/main/java/org/traccar/storage/DatabaseModule.java +++ b/src/main/java/org/traccar/storage/DatabaseModule.java @@ -78,7 +78,8 @@ public class DatabaseModule extends AbstractModule { DataSource dataSource = new HikariDataSource(hikariConfig); - if (config.hasKey(Keys.DATABASE_CHANGELOG)) { + String changelog = config.getString(Keys.DATABASE_CHANGELOG); + if (changelog != null && !changelog.isEmpty()) { ResourceAccessor resourceAccessor = new DirectoryResourceAccessor(new File(".")); @@ -89,8 +90,6 @@ public class DatabaseModule extends AbstractModule { config.getString(Keys.DATABASE_DRIVER), null, null, null, resourceAccessor); - String changelog = config.getString(Keys.DATABASE_CHANGELOG); - try (Liquibase liquibase = new Liquibase(changelog, resourceAccessor, database)) { liquibase.clearCheckSums(); liquibase.update(new Contexts()); |