Merge lp:~stevenk/launchpad/db-previewdiff-to-bmp into lp:launchpad/db-devel

Proposed by Steve Kowalik
Status: Merged
Approved by: Steve Kowalik
Approved revision: no longer in the source branch.
Merged at revision: 12412
Proposed branch: lp:~stevenk/launchpad/db-previewdiff-to-bmp
Merge into: lp:launchpad/db-devel
Diff against target: 17 lines (+13/-0)
1 file modified
database/schema/patch-2209-44-0.sql (+13/-0)
To merge this branch: bzr merge lp:~stevenk/launchpad/db-previewdiff-to-bmp
Reviewer Review Type Date Requested Status
Stuart Bishop (community) db Approve
William Grant db Pending
Review via email: mp+162909@code.launchpad.net

Commit message

Add two new columns to PreviewDiff -- branch_merge_proposal and date_created.

Description of the change

Add two new columns to PreviewDiff -- branch_merge_proposal and date_created, which will duplicate (and later, replace) the foreign key that currently points from BranchMergeProposal -> PreviewDiff, and allows us to have more than one PreviewDiff per merge proposal.

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

As mentioned on IRC, you will want an index on branch_merge_proposal or (branch_merge_proposal, date_created DESC)

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-44-0.sql'
2--- database/schema/patch-2209-44-0.sql 1970-01-01 00:00:00 +0000
3+++ database/schema/patch-2209-44-0.sql 2013-05-08 05:52:34 +0000
4@@ -0,0 +1,13 @@
5+-- Copyright 2013 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 previewdiff
11+ ADD COLUMN branch_merge_proposal integer REFERENCES branchmergeproposal,
12+ ADD COLUMN date_created timestamp without time zone;
13+ALTER TABLE previewdiff
14+ ALTER COLUMN date_created
15+ SET DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC');
16+
17+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 44, 0);

Subscribers

People subscribed via source and target branches

to status/vote changes: