diff options
Diffstat (limited to 'src/main/kotlin/moe/nea/ledger/database/Database.kt')
-rw-r--r-- | src/main/kotlin/moe/nea/ledger/database/Database.kt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/ledger/database/Database.kt b/src/main/kotlin/moe/nea/ledger/database/Database.kt index a77ea30..025888c 100644 --- a/src/main/kotlin/moe/nea/ledger/database/Database.kt +++ b/src/main/kotlin/moe/nea/ledger/database/Database.kt @@ -1,6 +1,7 @@ package moe.nea.ledger.database import moe.nea.ledger.Ledger +import moe.nea.ledger.database.columns.DBString import java.sql.Connection import java.sql.DriverManager @@ -42,6 +43,8 @@ class Database { val oldVersion = meta[MetaKey.DATABASE_VERSION]?.toLong() ?: -1 println("Old Database Version: $oldVersion; Current version: $databaseVersion") + if (oldVersion > databaseVersion) + error("Outdated software. Database is newer than me!") // TODO: create a backup if there is a db version upgrade happening DBUpgrade.performUpgradeChain( connection, oldVersion, databaseVersion, |