Schema update step to remove linked files from My Publications

This commit is contained in:
Dan Stillman 2017-04-27 15:25:50 -04:00
parent 9bd01af2a5
commit 7bd8f47dac
2 changed files with 9 additions and 1 deletions

View file

@ -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);

View file

@ -1,4 +1,4 @@
-- 93
-- 94
-- Copyright (c) 2009 Center for History and New Media
-- George Mason University, Fairfax, Virginia, USA