From 3eef17578da5a3653a9d2862b60ccfe08e61a6a9 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 21 Sep 2011 19:48:50 +0000 Subject: [PATCH] Just use INSERT OR IGNORE for all relations inserts --- chrome/content/zotero/xpcom/data/relation.js | 8 +------- 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 index 333be90635..9c1e81b34c 100644 --- 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(