You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
assert(newMFile(AppStorage.config.olddbpath5).exists, "Cannot find database path below data directory!")
303
+
Helpers.showInformation("Database upgrade finished", s"Please delete the old database folder\n${AppStorage.config.olddbpath}!")
304
+
}
305
+
// upgrade reftool5 derby to schema 4, then migrate to h2, schema 5
306
+
if (!newMFile(AppStorage.config.dbpath).exists &&newMFile(AppStorage.config.olddbpath5).exists) {
307
+
if (!Helpers.showWarning("About to update your database (derby->h2), have you backed it up?", "Continue?")) assert(assertion =false, "")
308
+
// upgrade derby schema to version 4 (rename SETTING.VALUE -> CONTENT)
309
+
assert(dbGetSchemaVersion(AppStorage.config.olddbpath5) <=4, "derby DB schema version is higher than reftool can handle - old reftool version?")
310
+
while (dbGetSchemaVersion(AppStorage.config.olddbpath5) !=4) dbSetSchemaVersion(AppStorage.config.olddbpath5, DBupgrades.upgradeSchema(dbGetSchemaVersion(AppStorage.config.olddbpath5)))
311
+
DBupgradesH2.upgrade5to5h2()
312
+
dbSetSchemaVersion(AppStorage.config.dbpath, 5)
313
+
Helpers.showInformation("Database upgrade finished", s"Please delete the old database folder\n${AppStorage.config.olddbpath5}!")
306
314
}
307
315
assert(newMFile(AppStorage.config.dbpath).exists, "Cannot find database path below data directory!")
308
316
assert(pp.exists, "Cannot find pdf path below data directory")
309
317
// upgrade DB schema if needed
310
-
assert(dbGetSchemaVersion <= lastschemaversion, "DB schema version is higher than reftool can handle - old reftool version?")
311
-
while (dbGetSchemaVersion != lastschemaversion) dbSetSchemaVersion(DBupgrades.upgradeSchema(dbGetSchemaVersion))
318
+
assert(dbGetSchemaVersion(AppStorage.config.dbpath) <=DBupgradesH2.lastschemaversion, "DB schema version is higher than reftool can handle - old reftool version?")
319
+
if (dbGetSchemaVersion(AppStorage.config.dbpath) !=DBupgradesH2.lastschemaversion)
320
+
if (!Helpers.showWarning("About to update your database, have you backed it up?", "Continue?")) assert(assertion =false, "")
321
+
while (dbGetSchemaVersion(AppStorage.config.dbpath) !=DBupgradesH2.lastschemaversion) dbSetSchemaVersion(AppStorage.config.dbpath, DBupgrades.upgradeSchema(dbGetSchemaVersion(AppStorage.config.dbpath)))
312
322
}
313
323
314
324
info("Loading database at "+AppStorage.config.dbpath +" ...")
0 commit comments