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.
This commit is contained in:
parent
3db915516a
commit
3c5bc44ddf
1 changed files with 1 additions and 1 deletions
|
@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue