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
=== added file 'database/schema/patch-2209-44-0.sql'
--- database/schema/patch-2209-44-0.sql 1970-01-01 00:00:00 +0000
+++ database/schema/patch-2209-44-0.sql 2013-05-08 05:52:34 +0000
@@ -0,0 +1,13 @@
1-- Copyright 2013 Canonical Ltd. This software is licensed under the
2-- GNU Affero General Public License version 3 (see the file LICENSE).
3
4SET client_min_messages=ERROR;
5
6ALTER TABLE previewdiff
7 ADD COLUMN branch_merge_proposal integer REFERENCES branchmergeproposal,
8 ADD COLUMN date_created timestamp without time zone;
9ALTER TABLE previewdiff
10 ALTER COLUMN date_created
11 SET DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC');
12
13INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 44, 0);

Subscribers

People subscribed via source and target branches

to status/vote changes: