Merge lp:~cjwatson/launchpad/db-snap-webhooks into lp:launchpad/db-devel

Proposed by Colin Watson on 2016-01-19
Status: Merged
Merged at revision: 13332
Proposed branch: lp:~cjwatson/launchpad/db-snap-webhooks
Merge into: lp:launchpad/db-devel
Diff against target: 18 lines (+14/-0)
1 file modified
database/schema/patch-2209-69-2.sql (+14/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad/db-snap-webhooks
Reviewer Review Type Date Requested Status
William Grant code Approve on 2016-01-28
Stuart Bishop db 2016-01-19 Pending
Launchpad code reviewers db 2016-01-19 Pending
Review via email:

Commit message

Add Webhook.snap column.

Description of the change

Add Webhook.snap column.

To post a comment you must log in.
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'database/schema/patch-2209-69-2.sql'
2--- database/schema/patch-2209-69-2.sql 1970-01-01 00:00:00 +0000
3+++ database/schema/patch-2209-69-2.sql 2016-01-19 17:41:57 +0000
4@@ -0,0 +1,14 @@
5+-- Copyright 2016 Canonical Ltd. This software is licensed under the
6+-- GNU Affero General Public License version 3 (see the file LICENSE).
8+SET client_min_messages=ERROR;
10+ALTER TABLE Webhook ADD COLUMN snap integer REFERENCES Snap;
12+ALTER TABLE Webhook DROP CONSTRAINT one_target;
13+ALTER TABLE Webhook ADD CONSTRAINT one_target CHECK (null_count(ARRAY[git_repository, branch, snap]) = 2);
15+CREATE INDEX webhook__snap__id__idx
16+ ON webhook(snap, id) WHERE snap IS NOT NULL;
18+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 69, 2);


People subscribed via source and target branches

to status/vote changes: