Merge lp:~brian-murray/launchpad/bug-600934 into lp:launchpad/db-devel

Proposed by Brian Murray
Status: Rejected
Rejected by: Brian Murray
Proposed branch: lp:~brian-murray/launchpad/bug-600934
Merge into: lp:launchpad/db-devel
Diff against target: 16 lines (+12/-0)
1 file modified
database/schema/patch-2207-67-0.sql (+12/-0)
To merge this branch: bzr merge lp:~brian-murray/launchpad/bug-600934
Reviewer Review Type Date Requested Status
Deryck Hodge (community) code Approve
Stuart Bishop (community) database Approve
Robert Collins db Pending
Review via email: mp+29775@code.launchpad.net

Commit message

add bugsubscription__person__bug__key to prevent people from being subscribed to the same bug report more than one time.

Description of the change

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.

To post a comment you must log in.
Revision history for this message
Stuart Bishop (stub) wrote :

The constraint name should be bugsubscription__person__bug__key. Otherwise great.

patch-2207-67-0.sql

review: Approve (database)
Revision history for this message
Deryck Hodge (deryck) wrote :

Yay for no code!

review: Approve (code)
Revision history for this message
Brian Murray (brian-murray) wrote :

The constraint revealed that the account merging process creates the duplicate subscriptions and modifying the process requires extensive work that the bugs team cannot take on. Subsequently, this constraint is being rejected and the database patch is no longer needed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'database/schema/patch-2207-67-0.sql'
2--- database/schema/patch-2207-67-0.sql 1970-01-01 00:00:00 +0000
3+++ database/schema/patch-2207-67-0.sql 2010-07-13 14:22:43 +0000
4@@ -0,0 +1,12 @@
5+SET client_min_messages=ERROR;
6+
7+DELETE FROM bugsubscription WHERE id NOT IN (
8+ SELECT MIN(dup.id) FROM
9+ bugsubscription AS dup
10+ GROUP BY dup.person, dup.bug);
11+
12+ALTER TABLE BugSubscription ADD CONSTRAINT bugsubscription__person__bug__key
13+ UNIQUE (person, bug);
14+
15+INSERT INTO LaunchpadDatabaseRevision VALUES (2207, 67, 0);
16+

Subscribers

People subscribed via source and target branches

to status/vote changes: