launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #24499
[Merge] ~cjwatson/launchpad:db-oci-recipe-build-job into launchpad:db-devel
Colin Watson has proposed merging ~cjwatson/launchpad:db-oci-recipe-build-job into launchpad:db-devel.
Commit message:
Add OCIRecipeBuildJob table
Requested reviews:
Launchpad code reviewers (launchpad-reviewers): db
Related bugs:
Bug #1847444 in Launchpad itself: "Support OCI image building"
https://bugs.launchpad.net/launchpad/+bug/1847444
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/381058
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:db-oci-recipe-build-job into launchpad:db-devel.
diff --git a/database/schema/patch-2210-08-7.sql b/database/schema/patch-2210-08-7.sql
new file mode 100644
index 0000000..122459e
--- /dev/null
+++ b/database/schema/patch-2210-08-7.sql
@@ -0,0 +1,20 @@
+-- Copyright 2020 Canonical Ltd. This software is licensed under the
+-- GNU Affero General Public License version 3 (see the file LICENSE).
+
+CREATE TABLE OCIRecipeBuildJob (
+ job integer PRIMARY KEY REFERENCES Job ON DELETE CASCADE NOT NULL,
+ build integer REFERENCES ocirecipebuild NOT NULL,
+ job_type integer NOT NULL,
+ json_data jsonb NOT NULL
+);
+
+COMMENT ON TABLE OCIRecipeBuildJob IS 'Contains references to jobs that are executed for a build of an OCI recipe.';
+COMMENT ON COLUMN OCIRecipeBuildJob.job IS 'A reference to a Job row that has all the common job details.';
+COMMENT ON COLUMN OCIRecipeBuildJob.build IS 'The OCI recipe build that this job is for.';
+COMMENT ON COLUMN OCIRecipeBuildJob.job_type IS 'The type of a job, such as a registry push.';
+COMMENT ON COLUMN OCIRecipeBuildJob.json_data IS 'Data that is specific to a particular job type.';
+
+CREATE INDEX ocirecipebuildjob__build__job_type__job__idx
+ ON OCIRecipeBuildJob (build, job_type, job);
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 08, 7);
diff --git a/database/schema/security.cfg b/database/schema/security.cfg
index 91b8407..f5cca8d 100644
--- a/database/schema/security.cfg
+++ b/database/schema/security.cfg
@@ -249,6 +249,7 @@ public.ocipushrule = SELECT, INSERT, UPDATE, DELETE
public.ocirecipe = SELECT, INSERT, UPDATE, DELETE
public.ocirecipearch = SELECT, INSERT, DELETE
public.ocirecipebuild = SELECT, INSERT, UPDATE, DELETE
+public.ocirecipebuildjob = SELECT, INSERT, UPDATE, DELETE
public.ociregistrycredentials = SELECT, INSERT, UPDATE, DELETE
public.officialbugtag = SELECT, INSERT, UPDATE, DELETE
public.openidconsumerassociation = SELECT, INSERT, UPDATE, DELETE
@@ -1000,6 +1001,7 @@ public.ociproject = SELECT
public.ociprojectname = SELECT
public.ocirecipe = SELECT
public.ocirecipebuild = SELECT, UPDATE
+public.ocirecipebuildjob = SELECT, INSERT
public.openididentifier = SELECT
public.packageset = SELECT
public.packagesetgroup = SELECT
@@ -1433,6 +1435,9 @@ public.milestonetag = SELECT
public.ociproject = SELECT
public.ociprojectname = SELECT
public.ociprojectseries = SELECT
+public.ocirecipe = SELECT, UPDATE
+public.ocirecipebuild = SELECT, UPDATE
+public.ocirecipebuildjob = SELECT, INSERT, UPDATE
public.openididentifier = SELECT
public.packagecopyjob = SELECT, INSERT
public.packagediff = SELECT, INSERT, UPDATE, DELETE