From 7bd8f47dac5e2223b177bd4d69774b4180e7e13f Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 27 Apr 2017 15:25:50 -0400 Subject: [PATCH] Schema update step to remove linked files from My Publications --- chrome/content/zotero/xpcom/schema.js | 8 ++++++++ resource/schema/userdata.sql | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js index d0544105f..8b0c7bedd 100644 --- a/chrome/content/zotero/xpcom/schema.js +++ b/chrome/content/zotero/xpcom/schema.js @@ -2408,6 +2408,14 @@ Zotero.Schema = new function(){ + ids.map(id => `(${id})`).join(', ')); } } + + else if (i == 94) { + let ids = yield Zotero.DB.columnQueryAsync("SELECT itemID FROM publicationsItems WHERE itemID IN (SELECT itemID FROM items JOIN itemAttachments USING (itemID) WHERE linkMode=2)"); + for (let id of ids) { + yield Zotero.DB.queryAsync("UPDATE items SET synced=0, clientDateModified=CURRENT_TIMESTAMP WHERE itemID=?", id); + } + yield Zotero.DB.queryAsync("DELETE FROM publicationsItems WHERE itemID IN (SELECT itemID FROM items JOIN itemAttachments USING (itemID) WHERE linkMode=2)"); + } } yield _updateDBVersion('userdata', toVersion); diff --git a/resource/schema/userdata.sql b/resource/schema/userdata.sql index 54d1bd03f..b6f5df10b 100644 --- a/resource/schema/userdata.sql +++ b/resource/schema/userdata.sql @@ -1,4 +1,4 @@ --- 93 +-- 94 -- Copyright (c) 2009 Center for History and New Media -- George Mason University, Fairfax, Virginia, USA