commit 3eef17578da5a3653a9d2862b60ccfe08e61a6a9
parent 8b263ff8e46360e2710b8379352257fa220cec09
Author: Dan Stillman <dstillman@zotero.org>
Date: Wed, 21 Sep 2011 19:48:50 +0000
Just use INSERT OR IGNORE for all relations inserts
Diffstat:
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/chrome/content/zotero/xpcom/data/relation.js b/chrome/content/zotero/xpcom/data/relation.js
@@ -158,13 +158,7 @@ Zotero.Relation.prototype.save = function () {
throw ("Missing object in Zotero.Relation.save()");
}
- // Hack to deal with duplicate relations inserted in the wrong order in 3.0b1
- //
- // This could possibly be addressed by a database upgrade step that deleted
- // any deletedItemPredicate relations _from_ existing non-trashed items
- var ignore = this.predicate == Zotero.Relations.deletedItemPredicate ? "OR IGNORE " : "";
-
- var sql = "INSERT " + ignore + "INTO relations "
+ var sql = "INSERT OR IGNORE INTO relations "
+ "(libraryID, subject, predicate, object, clientDateModified) "
+ "VALUES (?, ?, ?, ?, ?)";
var insertID = Zotero.DB.query(