← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:merge-db-stable into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:merge-db-stable into launchpad:master.

Commit message:
Merge db-stable 1441081d42 (Add livefs to Webhook table)

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/378026
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:merge-db-stable into launchpad:master.
diff --git a/database/schema/patch-2210-10-0.sql b/database/schema/patch-2210-10-0.sql
new file mode 100644
index 0000000..8ea0a85
--- /dev/null
+++ b/database/schema/patch-2210-10-0.sql
@@ -0,0 +1,14 @@
+-- Copyright 2019 Canonical Ltd.  This software is licensed under the
+-- GNU Affero General Public License version 3 (see the file LICENSE).
+
+SET client_min_messages=ERROR;
+
+ALTER TABLE Webhook ADD COLUMN livefs integer REFERENCES livefs;
+
+ALTER TABLE Webhook DROP CONSTRAINT one_target;
+ALTER TABLE Webhook ADD CONSTRAINT one_target CHECK (null_count(ARRAY[git_repository, branch, snap, livefs]) = 3);
+
+CREATE INDEX webhook__livefs__id__idx
+    ON webhook(livefs, id) WHERE livefs IS NOT NULL;
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 10, 0);