← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~pappacena/launchpad:db-patch-lp-signing-integration into launchpad:db-devel

 

Thiago F. Pappacena has proposed merging ~pappacena/launchpad:db-patch-lp-signing-integration into launchpad:db-devel.

Commit message:
Database patch for signing service integration tables.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/379218
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~pappacena/launchpad:db-patch-lp-signing-integration into launchpad:db-devel.
diff --git a/database/schema/patch-2210-12-0.sql b/database/schema/patch-2210-12-0.sql
new file mode 100644
index 0000000..6e63371
--- /dev/null
+++ b/database/schema/patch-2210-12-0.sql
@@ -0,0 +1,35 @@
+-- Copyright 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;
+
+
+CREATE TABLE signingkey (
+    id serial PRIMARY KEY,
+    key_type integer NOT NULL,
+    description text NULL,
+    fingerprint text NOT NULL,
+    public_key bytea NOT NULL,
+    date_created timestamp without time zone NOT NULL
+        DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC')
+);
+
+
+CREATE TABLE archivesigningkey (
+    id serial PRIMARY KEY,
+    archive integer NOT NULL REFERENCES archive,
+    distro_series integer NULL REFERENCES distroseries,
+    signing_key integer NOT NULL REFERENCES signingkey,
+    date_created timestamp without time zone NOT NULL
+        DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC')
+);
+
+
+CREATE INDEX archivesigningkey__archive__idx
+    ON archivesigningkey(archive);
+
+CREATE INDEX archivesigningkey__distro_series__idx
+    ON archivesigningkey(distro_series);
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 12, 0);
+
diff --git a/database/schema/security.cfg b/database/schema/security.cfg
index 5894f34..5da1e0c 100644
--- a/database/schema/security.cfg
+++ b/database/schema/security.cfg
@@ -1195,6 +1195,7 @@ public.account                          = SELECT, INSERT, UPDATE
 public.archive                          = SELECT, INSERT, UPDATE
 public.archivearch                      = SELECT, INSERT, UPDATE, DELETE
 public.archivejob                       = SELECT, INSERT
+public.archivesigningkey                = SELECT, INSERT, UPDATE
 public.binarypackagebuild               = SELECT, INSERT, UPDATE
 public.binarypackagefile                = SELECT, INSERT, UPDATE
 public.binarypackagename                = SELECT, INSERT, UPDATE
@@ -1272,6 +1273,7 @@ public.project                          = SELECT, INSERT, UPDATE
 public.section                          = SELECT, INSERT, UPDATE
 public.sectionselection                 = SELECT, INSERT, UPDATE
 public.signedcodeofconduct              = SELECT, INSERT, UPDATE
+public.signingkey                       = SELECT, INSERT, UPDATE
 public.sourcepackageformatselection     = SELECT, INSERT
 public.sourcepackagename                = SELECT, INSERT, UPDATE
 public.sourcepackagepublishinghistory   = SELECT, INSERT, UPDATE
@@ -1365,6 +1367,7 @@ public.archivearch                      = SELECT, INSERT, UPDATE
 public.archivefile                      = SELECT
 public.archivejob                       = SELECT, INSERT
 public.archivepermission                = SELECT
+public.archivesigningkey                = SELECT, INSERT
 public.binarypackagebuild               = SELECT, INSERT, UPDATE
 public.binarypackagefile                = SELECT, INSERT
 public.binarypackagename                = SELECT, INSERT
@@ -1459,6 +1462,7 @@ public.snapbuild                        = SELECT, UPDATE
 public.snapbuildjob                     = SELECT, INSERT, UPDATE
 public.snapfile                         = SELECT, INSERT, UPDATE
 public.snappyseries                     = SELECT
+public.signingkey                       = SELECT, INSERT
 public.sourcepackageformatselection     = SELECT
 public.sourcepackagename                = SELECT, INSERT
 public.sourcepackagepublishinghistory   = SELECT, INSERT

Follow ups