← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~brian-murray/launchpad/bug-600934 into lp:launchpad

 

Brian Murray has proposed merging lp:~brian-murray/launchpad/bug-600934 into lp:launchpad.

Requested reviews:
  Stuart Bishop (stub): database
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  #600934 BugSubscription table need a constraint to prevent people being subscribed twice to the same bug
  https://bugs.launchpad.net/bugs/600934


This branch adds a constraint to the bugsubscription table to prevent people from being subscribed to the same bug report more than one time.  Additionally, it removes the most recent duplicate bug subscription(s) from that table for people who are subscribed to a bug report more than one time.
-- 
https://code.launchpad.net/~brian-murray/launchpad/bug-600934/+merge/29775
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~brian-murray/launchpad/bug-600934 into lp:launchpad.
=== added file 'database/schema/patch-2207-99-0.sql'
--- database/schema/patch-2207-99-0.sql	1970-01-01 00:00:00 +0000
+++ database/schema/patch-2207-99-0.sql	2010-07-13 09:11:00 +0000
@@ -0,0 +1,12 @@
+SET client_min_messages=ERROR;
+
+DELETE FROM bugsubscription WHERE id NOT IN (
+    SELECT MIN(dup.id) FROM
+    bugsubscription AS dup 
+    GROUP BY dup.person, dup.bug);
+
+ALTER TABLE BugSubscription ADD CONSTRAINT bugsubscription__no_duplicate_subscription
+    UNIQUE (person, bug);
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2207, 99, 0);
+


Follow ups