Fix "constraint failed" error when trying to delete attachment with annotations/highlights
This commit is contained in:
parent
fc06a51592
commit
f76f387c5f
|
@ -3219,6 +3219,8 @@ Zotero.Item.prototype.erase = function(deleteChildren) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Zotero.DB.query('DELETE FROM annotations WHERE itemID=?', this.id);
|
||||||
|
Zotero.DB.query('DELETE FROM highlights WHERE itemID=?', this.id);
|
||||||
Zotero.DB.query('DELETE FROM itemCreators WHERE itemID=?', this.id);
|
Zotero.DB.query('DELETE FROM itemCreators WHERE itemID=?', this.id);
|
||||||
Zotero.DB.query('DELETE FROM itemNotes WHERE itemID=?', this.id);
|
Zotero.DB.query('DELETE FROM itemNotes WHERE itemID=?', this.id);
|
||||||
Zotero.DB.query('DELETE FROM itemAttachments WHERE itemID=?', this.id);
|
Zotero.DB.query('DELETE FROM itemAttachments WHERE itemID=?', this.id);
|
||||||
|
@ -3227,8 +3229,6 @@ Zotero.Item.prototype.erase = function(deleteChildren) {
|
||||||
Zotero.DB.query('DELETE FROM itemTags WHERE itemID=?', this.id);
|
Zotero.DB.query('DELETE FROM itemTags WHERE itemID=?', this.id);
|
||||||
Zotero.DB.query('DELETE FROM itemData WHERE itemID=?', this.id);
|
Zotero.DB.query('DELETE FROM itemData WHERE itemID=?', this.id);
|
||||||
Zotero.DB.query('DELETE FROM items WHERE itemID=?', this.id);
|
Zotero.DB.query('DELETE FROM items WHERE itemID=?', this.id);
|
||||||
Zotero.DB.query('DELETE FROM annotations WHERE itemID=?', this.id);
|
|
||||||
Zotero.DB.query('DELETE FROM highlights WHERE itemID=?', this.id);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Zotero.DB.commitTransaction();
|
Zotero.DB.commitTransaction();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user