Remove invalid relations mangled during import
Not sure if this occurred for our own translators, but it addresses items created from #1282.
This commit is contained in:
parent
0d3d4323b5
commit
a455a72534
|
@ -2469,6 +2469,16 @@ Zotero.Schema = new function(){
|
||||||
yield Zotero.DB.queryAsync("REPLACE INTO fileTypeMIMETypes VALUES(7, 'application/vnd.ms-powerpoint')");
|
yield Zotero.DB.queryAsync("REPLACE INTO fileTypeMIMETypes VALUES(7, 'application/vnd.ms-powerpoint')");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (i == 97) {
|
||||||
|
let where = "WHERE predicate IN (" + Array.from(Array(20).keys()).map(i => `'${i}'`).join(', ') + ")";
|
||||||
|
let rows = yield Zotero.DB.queryAsync("SELECT * FROM relationPredicates " + where);
|
||||||
|
for (let row of rows) {
|
||||||
|
yield Zotero.DB.columnQueryAsync("UPDATE items SET synced=0 WHERE itemID IN (SELECT itemID FROM itemRelations WHERE predicateID=?)", row.predicateID);
|
||||||
|
yield Zotero.DB.queryAsync("DELETE FROM itemRelations WHERE predicateID=?", row.predicateID);
|
||||||
|
}
|
||||||
|
yield Zotero.DB.queryAsync("DELETE FROM relationPredicates " + where);
|
||||||
|
}
|
||||||
|
|
||||||
// If breaking compatibility or doing anything dangerous, clear minorUpdateFrom
|
// If breaking compatibility or doing anything dangerous, clear minorUpdateFrom
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
-- 96
|
-- 97
|
||||||
|
|
||||||
-- Copyright (c) 2009 Center for History and New Media
|
-- Copyright (c) 2009 Center for History and New Media
|
||||||
-- George Mason University, Fairfax, Virginia, USA
|
-- George Mason University, Fairfax, Virginia, USA
|
||||||
|
|
Loading…
Reference in New Issue
Block a user