www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 3c5bc44ddf5c1dd11a5141b463779d507c411c28
parent 3db915516ac6d87d1e613093e50e587f674f9de1
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue, 27 Mar 2018 10:42:01 -0400

Fix potential upgrade error from c96363746b

If a related item was defined using both an old userID and the current
one, the schema upgrade step could fail.

Diffstat:
Mchrome/content/zotero/xpcom/schema.js | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js @@ -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]); } } }