← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~pappacena/launchpad:db-patch-https-mirrors into launchpad:db-devel

 

Thiago F. Pappacena has proposed merging ~pappacena/launchpad:db-patch-https-mirrors into launchpad:db-devel.

Commit message:
Database patch to support HTTPS mirrors

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/379504

Related work: https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/379387
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~pappacena/launchpad:db-patch-https-mirrors into launchpad:db-devel.
diff --git a/database/schema/patch-2210-13-0.sql b/database/schema/patch-2210-13-0.sql
new file mode 100644
index 0000000..dada0ec
--- /dev/null
+++ b/database/schema/patch-2210-13-0.sql
@@ -0,0 +1,15 @@
+-- Copyright 2019-2020 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 DistributionMirror
+    ADD COLUMN https_base_url text,
+    ADD CONSTRAINT distributionmirror_https_base_url_key UNIQUE (https_base_url),
+    ADD CONSTRAINT valid_https_base_url CHECK (valid_absolute_url(https_base_url)),
+    DROP CONSTRAINT one_or_more_urls,
+    ADD CONSTRAINT one_or_more_urls CHECK (http_base_url IS NOT NULL OR https_base_url IS NOT NULL OR ftp_base_url IS NOT NULL OR rsync_base_url IS NOT NULL);
+
+COMMENT ON COLUMN DistributionMirror.https_base_url IS 'The HTTPS URL used to access the mirror.';
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 13, 0);

Follow ups