commit 7bd8f47dac5e2223b177bd4d69774b4180e7e13f
parent 9bd01af2a5c72a2ac62002113d69b279a2e5f5c7
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 27 Apr 2017 15:25:50 -0400
Schema update step to remove linked files from My Publications
Diffstat:
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git 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
@@ -1,4 +1,4 @@
--- 93
+-- 94
-- Copyright (c) 2009 Center for History and New Media
-- George Mason University, Fairfax, Virginia, USA