← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Guruprasad has proposed merging ~lgp171188/launchpad:merge-db-stable into launchpad:master.

Commit message:
Merge db-stable 0f18c28eeb (Add RockBase, RockBaseArch tables)

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~lgp171188/launchpad/+git/launchpad/+merge/473496
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~lgp171188/launchpad:merge-db-stable into launchpad:master.
diff --git a/database/schema/patch-2211-28-1.sql b/database/schema/patch-2211-28-1.sql
new file mode 100644
index 0000000..3046b40
--- /dev/null
+++ b/database/schema/patch-2211-28-1.sql
@@ -0,0 +1,33 @@
+-- Copyright 2024 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 RockBase (
+    id serial PRIMARY KEY,
+    date_created timestamp without time zone DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') NOT NULL,
+    registrant integer NOT NULL REFERENCES person,
+    distro_series integer NOT NULL REFERENCES distroseries,
+    build_channels text NOT NULL
+);
+
+CREATE INDEX rockbase__registrant__idx ON RockBase (registrant);
+CREATE UNIQUE INDEX rockbase__distro_series__key ON RockBase (distro_series);
+
+COMMENT ON TABLE RockBase IS 'A base for rocks.';
+COMMENT ON COLUMN RockBase.date_created IS 'The date on which this base was created in Launchpad.';
+COMMENT ON COLUMN RockBase.registrant IS 'The user who registered this base.';
+COMMENT ON COLUMN RockBase.distro_series IS 'The distro series for this base.';
+COMMENT ON COLUMN RockBase.build_channels IS 'A dictionary mapping snap names to channels to use when building rock recipes that specify this base.';
+
+CREATE TABLE RockBaseArch (
+    rock_base integer NOT NULL REFERENCES rockbase,
+    processor integer NOT NULL REFERENCES processor,
+    PRIMARY KEY (rock_base, processor)
+);
+
+COMMENT ON TABLE RockBaseArch IS 'The architectures that a rock base supports.';
+COMMENT ON COLUMN RockBaseArch.rock_base IS 'The rock base for which a supported architecture is specified.';
+COMMENT ON COLUMN RockBaseArch.processor IS 'A supported architecture for this rock base.';
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2211, 28, 1);
diff --git a/database/schema/security.cfg b/database/schema/security.cfg
index e7b609b..157818d 100644
--- a/database/schema/security.cfg
+++ b/database/schema/security.cfg
@@ -312,6 +312,8 @@ public.revisioncache                    = SELECT, INSERT, UPDATE, DELETE
 public.revisionparent                   = SELECT, INSERT
 public.revisionstatusartifact           = SELECT, INSERT, UPDATE, DELETE
 public.revisionstatusreport             = SELECT, INSERT, UPDATE, DELETE
+public.rockbase                        = SELECT, INSERT, UPDATE, DELETE
+public.rockbasearch                    = SELECT, INSERT, DELETE
 public.rockfile                        = SELECT, INSERT, UPDATE, DELETE
 public.rockrecipe                      = SELECT, INSERT, UPDATE, DELETE
 public.rockrecipebuild                 = SELECT, INSERT, UPDATE, DELETE
@@ -2472,6 +2474,7 @@ public.questionsubscription             = SELECT, UPDATE, DELETE
 public.revision                         = SELECT, UPDATE
 public.revisionauthor                   = SELECT, UPDATE
 public.revisionstatusreport             = SELECT, UPDATE
+public.rockbase                        = SELECT, UPDATE
 public.rockrecipe                      = SELECT, UPDATE
 public.rockrecipebuild                 = SELECT, UPDATE
 public.seriessourcepackagebranch        = SELECT, UPDATE