Merge lp:~stub/launchpad/pending-db-changes into lp:launchpad/db-devel

Proposed by Stuart Bishop
Status: Merged
Approved by: Stuart Bishop
Approved revision: not available
Merged at revision: 10499
Proposed branch: lp:~stub/launchpad/pending-db-changes
Merge into: lp:launchpad/db-devel
Diff against target: 22 lines (+12/-0)
1 file modified
database/schema/patch-2208-65-0.sql (+12/-0)
To merge this branch: bzr merge lp:~stub/launchpad/pending-db-changes
Reviewer Review Type Date Requested Status
Robert Collins (community) release-critical Approve
Stuart Bishop (community) Approve
Review via email: mp+59640@code.launchpad.net

Commit message

Attempt to fix patch-2208-65-0.sql against production data by making the BugSubscriptionFilter -> StructuralSubscription relationship ON DELETE CASCADE

Description of the change

Attempt to fix patch-2208-65-0.sql against production data by making the BugSubscriptionFilter -> StructuralSubscription relationship ON DELETE CASCADE

To post a comment you must log in.
Revision history for this message
Stuart Bishop (stub) :
review: Approve
Revision history for this message
Robert Collins (lifeless) :
review: Approve (release-critical)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'database/schema/patch-2208-65-0.sql'
2--- database/schema/patch-2208-65-0.sql 2011-04-27 14:51:54 +0000
3+++ database/schema/patch-2208-65-0.sql 2011-05-02 07:21:35 +0000
4@@ -3,6 +3,18 @@
5
6 SET client_min_messages=ERROR;
7
8+-- Before we remove unwanted StructuralSubscription rows, we can tweak
9+-- some foreign key constraints to make this removal easier.
10+-- StructuralSubscription is referenced by BugSubscriptionFilter
11+-- BugSubscriptionFilter is referenced too by BugNotificationFilter, but
12+-- that relationship is already ON DELETE CASCADE.
13+ALTER TABLE BugSubscriptionFilter
14+ DROP CONSTRAINT bugsubscriptionfilter_structuralsubscription_fkey,
15+ ADD CONSTRAINT bugsubscriptionfilter__structuralsubscription__fk
16+ FOREIGN KEY (structuralsubscription)
17+ REFERENCES StructuralSubscription ON DELETE CASCADE;
18+
19+
20 -- WHAT ARE WE DOING? -----------------------------------------------------
21
22 -- These three errors have been observed, and are corrected here.

Subscribers

People subscribed via source and target branches

to status/vote changes: