Merge lp:~wallyworld/launchpad/latestpublishedreleases-person-fk-1071581 into lp:launchpad/db-devel

Proposed by Ian Booth
Status: Merged
Merged at revision: 12120
Proposed branch: lp:~wallyworld/launchpad/latestpublishedreleases-person-fk-1071581
Merge into: lp:launchpad/db-devel
Diff against target: 18 lines (+14/-0)
1 file modified
database/schema/patch-2209-38-1.sql (+14/-0)
To merge this branch: bzr merge lp:~wallyworld/launchpad/latestpublishedreleases-person-fk-1071581
Reviewer Review Type Date Requested Status
Stuart Bishop (community) db Approve
William Grant Pending
Review via email: mp+133162@code.launchpad.net

Commit message

Add person foreign keys to the creator and maintainer columns on the LatestPersonSourcePackageReleaseCache table.

Description of the change

A previous db patch added a new LatestPersonSourcePackageReleaseCache table, but the person FK's could not be added immediately.

Once the necessary model code lands, the Person foreign keys can be added to the creator and maintainer columns on the LatestPersonSourcePackageReleaseCache table.

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

Yup

review: Approve (db)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'database/schema/patch-2209-38-1.sql'
2--- database/schema/patch-2209-38-1.sql 1970-01-01 00:00:00 +0000
3+++ database/schema/patch-2209-38-1.sql 2012-11-07 03:55:31 +0000
4@@ -0,0 +1,14 @@
5+-- Copyright 2012 Canonical Ltd. This software is licensed under the
6+-- GNU Affero General Public License version 3 (see the file LICENSE).
7+
8+SET client_min_messages=ERROR;
9+
10+ALTER TABLE ONLY latestpersonsourcepackagereleasecache
11+ ADD CONSTRAINT creator_fkey FOREIGN KEY (creator) REFERENCES person(id)
12+ ON DELETE CASCADE;
13+
14+ALTER TABLE ONLY latestpersonsourcepackagereleasecache
15+ ADD CONSTRAINT maintainer_fkey FOREIGN KEY (maintainer) REFERENCES person(id)
16+ ON DELETE CASCADE;
17+
18+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 38, 1);

Subscribers

People subscribed via source and target branches

to status/vote changes: