Schema upgrade debugging

Include flags in repo update checks indicating whether a database table
that was previously supposed to be removed was removed and whether a new
table was created. This should help us figure out whether we can safely
perform schema update steps or whether we need to figure out why some
schema update steps aren't being applied.
This commit is contained in:
Dan Stillman 2020-06-21 03:08:03 -04:00
parent 42ac976f1e
commit 3e8f0af583
2 changed files with 22 additions and 2 deletions

View file

@ -1514,6 +1514,18 @@ Zotero.Schema = new function(){
url += '&m=' + mode;
}
// TEMP: DB diagnostics
let exists = yield Zotero.DB.tableExists('transactionSets');
url += "&ts=" + (exists ? "1" : "0");
if (exists) {
Zotero.logError("DB table 'transactionSets' still exists");
}
exists = yield Zotero.DB.tableExists('dbDebug1');
url += "&db1=" + (exists ? "1" : "0");
if (!exists) {
Zotero.logError("DB table 'dbDebug1' does not exist");
}
// Send list of installed styles
var styles = Zotero.Styles.getAll();
var styleTimestamps = [];
@ -3025,6 +3037,10 @@ Zotero.Schema = new function(){
yield Zotero.DB.queryAsync(`DELETE FROM itemRelations WHERE predicateID=(SELECT predicateID FROM relationPredicates WHERE predicate='owl:sameAs') AND object LIKE ?`, 'http://zotero.org/users/local/%');
}
else if (i == 109) {
yield Zotero.DB.queryAsync("CREATE TABLE dbDebug1 (\n a INTEGER PRIMARY KEY\n)");
}
// If breaking compatibility or doing anything dangerous, clear minorUpdateFrom
}

View file

@ -1,4 +1,4 @@
-- 108
-- 109
-- Copyright (c) 2009 Center for History and New Media
-- George Mason University, Fairfax, Virginia, USA
@ -456,4 +456,8 @@ CREATE TABLE translatorCache (
fileName TEXT PRIMARY KEY,
metadataJSON TEXT,
lastModifiedTime INT
);
);
CREATE TABLE dbDebug1 (
a INTEGER PRIMARY KEY
);