Fixed crash on database upgrade.
This commit is contained in:
parent
343c5fca07
commit
6bebfcf3cf
1 changed files with 1 additions and 0 deletions
|
@ -105,6 +105,7 @@ class Database(path: File, settings: SettingsInterface, callbackInterface: Callb
|
||||||
return
|
return
|
||||||
|
|
||||||
logger.info(s"Upgrading database from version $oldVersion to $DatabaseVersion")
|
logger.info(s"Upgrading database from version $oldVersion to $DatabaseVersion")
|
||||||
|
Class.forName("org.h2.Driver")
|
||||||
val connection = DriverManager.getConnection(DatabasePath)
|
val connection = DriverManager.getConnection(DatabasePath)
|
||||||
if (oldVersion <= 2) {
|
if (oldVersion <= 2) {
|
||||||
connection.createStatement().executeUpdate("ALTER TABLE MESSAGES ADD COLUMN (tokens INT);")
|
connection.createStatement().executeUpdate("ALTER TABLE MESSAGES ADD COLUMN (tokens INT);")
|
||||||
|
|
Reference in a new issue