Skip to content

Commit

Permalink
Fix potential upgrade error from c963637
Browse files Browse the repository at this point in the history
If a related item was defined using both an old userID and the current
one, the schema upgrade step could fail.
  • Loading branch information
dstillman committed Mar 27, 2018
1 parent 3db9155 commit 3c5bc44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chrome/content/zotero/xpcom/schema.js
Expand Up @@ -2424,7 +2424,7 @@ Zotero.Schema = new function(){
if (matches) {
// Wrong libraryID
if (matches[1] != userID) {
yield Zotero.DB.queryAsync(`UPDATE itemRelations SET object='http://zotero.org/users/${userID}/items/${matches[2]}' WHERE itemID=? AND predicateID=?`, [row.itemID, predicateID]);
yield Zotero.DB.queryAsync(`UPDATE OR REPLACE itemRelations SET object='http://zotero.org/users/${userID}/items/${matches[2]}' WHERE itemID=? AND predicateID=?`, [row.itemID, predicateID]);
}
}
}
Expand Down

0 comments on commit 3c5bc44

Please sign in to comment.