Fix "no such table: retractedItems" error from skipped schema update

I'm not sure what's going on, but schema update steps aren't working
properly for a small number of people:

https://forums.zotero.org/discussion/78272/urgent-database-connector-upgrade-error
This commit is contained in:
Dan Stillman 2019-07-18 05:19:18 -04:00
parent a41e610e6c
commit 9020566de1

View file

@ -2513,12 +2513,12 @@ Zotero.Schema = new function(){
}
}
else if (i == 104) {
// Didn't take for some people in 103 for some reason, so run again with IF NOT EXISTS
yield Zotero.DB.queryAsync("CREATE TABLE IF NOT EXISTS retractedItems (\n itemID INTEGER PRIMARY KEY,\n data TEXT,\n FOREIGN KEY (itemID) REFERENCES items(itemID) ON DELETE CASCADE\n);");
}
else if (i == 105) {
// This was originally in 103 and then 104, but some schema update steps are being
// missed for some people, so run again with IF NOT EXISTS until we figure out
// what's going on.
yield Zotero.DB.queryAsync("CREATE TABLE IF NOT EXISTS retractedItems (\n itemID INTEGER PRIMARY KEY,\n data TEXT,\n FOREIGN KEY (itemID) REFERENCES items(itemID) ON DELETE CASCADE\n);");
yield Zotero.DB.queryAsync("ALTER TABLE retractedItems ADD COLUMN flag INT DEFAULT 0");
}