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

Proposed by Colin Watson
Status: Merged
Merged at revision: 13225
Proposed branch: lp:~cjwatson/launchpad/db-bzr-webhooks
Merge into: lp:launchpad/db-devel
Diff against target: 18 lines (+14/-0)
1 file modified
database/schema/patch-2209-66-1.sql (+14/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad/db-bzr-webhooks
Reviewer Review Type Date Requested Status
William Grant db Approve
Stuart Bishop db Pending
Review via email: mp+272229@code.launchpad.net

Commit message

Add Webhook.branch.

Description of the change

Add Webhook.branch. It's relatively easy to get Bazaar branch webhooks working given this.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
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-66-1.sql'
2--- database/schema/patch-2209-66-1.sql 1970-01-01 00:00:00 +0000
3+++ database/schema/patch-2209-66-1.sql 2015-09-24 12:10:24 +0000
4@@ -0,0 +1,14 @@
5+-- Copyright 2015 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 Webhook ADD COLUMN branch integer REFERENCES Branch;
11+
12+ALTER TABLE Webhook DROP CONSTRAINT webhook_git_repository_check;
13+ALTER TABLE Webhook ADD CONSTRAINT one_target CHECK ((git_repository IS NOT NULL) != (branch IS NOT NULL));
14+
15+CREATE INDEX webhook__branch__id__idx
16+ ON webhook(branch, id) WHERE branch IS NOT NULL;
17+
18+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 66, 1);

Subscribers

People subscribed via source and target branches

to status/vote changes: