From 2094a6023c992c5b6d660a1f29a1f367cd1b2368 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 11 Jan 2021 13:27:24 -0500 Subject: [PATCH] Restore fallback DB creation in retractions.js Removed in 5b9e6497af, but then we reverted missing-table creation via schema integrity check --- chrome/content/zotero/xpcom/retractions.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chrome/content/zotero/xpcom/retractions.js b/chrome/content/zotero/xpcom/retractions.js index 707ce7a2d1..41c1a6a3db 100644 --- a/chrome/content/zotero/xpcom/retractions.js +++ b/chrome/content/zotero/xpcom/retractions.js @@ -48,6 +48,14 @@ Zotero.Retractions = { return; } + // TEMP: Until we can figure out why some schema updates aren't going through despite the + // version number being incremented, create table here if it's missing + await 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);"); + try { + await Zotero.DB.queryAsync("ALTER TABLE retractedItems ADD COLUMN flag INT DEFAULT 0"); + } + catch (e) {} + // Load mappings of keys (DOI hashes and PMIDs) to items and vice versa and register for // item changes so they can be kept up to date in notify(). await this._cacheKeyMappings();