www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 351d904dbeb16fa48415052aa3ae99206830c0a4
parent 6bed1231b306ee7f958937470b107882ca031fe6
Author: Dan Stillman <dstillman@zotero.org>
Date:   Thu, 26 Nov 2009 06:44:10 +0000

Modifying a standalone note would remove it from any collections it was in (since 2.0b7.5)


Diffstat:
Mtriggers.sql | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/triggers.sql b/triggers.sql @@ -1,4 +1,4 @@ --- 13 +-- 14 -- Triggers to validate date field DROP TRIGGER IF EXISTS insert_date_field; @@ -283,7 +283,7 @@ CREATE TRIGGER fku_itemAttachments_sourceItemID_collectionItems_itemID DROP TRIGGER IF EXISTS fku_itemNotes_sourceItemID_collectionItems_itemID; CREATE TRIGGER fku_itemNotes_sourceItemID_collectionItems_itemID BEFORE UPDATE OF sourceItemID ON itemNotes - FOR EACH ROW BEGIN + FOR EACH ROW WHEN OLD.sourceItemID IS NULL AND NEW.sourceItemID IS NOT NULL BEGIN DELETE FROM collectionItems WHERE itemID = NEW.itemID; END;