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

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 640200fdc75628207a1fec18b8350e2494cd8376
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:merge-db-stable
Merge into: launchpad:master
Diff against target: 71 lines (+48/-0)
3 files modified
database/schema/patch-2210-13-0.sql (+25/-0)
database/schema/patch-2210-15-0.sql (+22/-0)
database/schema/security.cfg (+1/-0)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+382574@code.launchpad.net

Commit message

Merge db-stable 640200fdc7 (Add BinarySourceReference and OCIRecipeJob tables)

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Deployed to the production database today.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/database/schema/patch-2210-13-0.sql b/database/schema/patch-2210-13-0.sql
2new file mode 100644
3index 0000000..0889468
4--- /dev/null
5+++ b/database/schema/patch-2210-13-0.sql
6@@ -0,0 +1,25 @@
7+-- Copyright 2020 Canonical Ltd. This software is licensed under the
8+-- GNU Affero General Public License version 3 (see the file LICENSE).
9+
10+SET client_min_messages=ERROR;
11+
12+CREATE TABLE BinarySourceReference (
13+ id serial PRIMARY KEY,
14+ binary_package_release integer NOT NULL REFERENCES binarypackagerelease,
15+ source_package_release integer NOT NULL REFERENCES sourcepackagerelease,
16+ reference_type integer NOT NULL
17+);
18+
19+COMMENT ON TABLE BinarySourceReference IS 'A reference from a binary package release to a source package release.';
20+COMMENT ON COLUMN BinarySourceReference.binary_package_release IS 'The referencing binary package release.';
21+COMMENT ON COLUMN BinarySourceReference.source_package_release IS 'The referenced source package release.';
22+COMMENT ON COLUMN BinarySourceReference.reference_type IS 'The type of the reference.';
23+
24+CREATE INDEX binarysourcereference__bpr__type__idx
25+ ON BinarySourceReference (binary_package_release, reference_type);
26+CREATE INDEX binarysourcereference__spr__type__idx
27+ ON BinarySourceReference (source_package_release, reference_type);
28+CREATE UNIQUE INDEX binarysourcereference__bpr__spr__type__key
29+ ON BinarySourceReference (binary_package_release, source_package_release, reference_type);
30+
31+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 13, 0);
32diff --git a/database/schema/patch-2210-15-0.sql b/database/schema/patch-2210-15-0.sql
33new file mode 100644
34index 0000000..9fd355b
35--- /dev/null
36+++ b/database/schema/patch-2210-15-0.sql
37@@ -0,0 +1,22 @@
38+-- Copyright 2020 Canonical Ltd. This software is licensed under the
39+-- GNU Affero General Public License version 3 (see the file LICENSE).
40+
41+SET client_min_messages=ERROR;
42+
43+CREATE TABLE OCIRecipeJob (
44+ job integer PRIMARY KEY REFERENCES Job ON DELETE CASCADE NOT NULL,
45+ recipe INTEGER NOT NULL REFERENCES OCIRecipe,
46+ job_type INTEGER NOT NULL,
47+ json_data jsonb NOT NULL
48+);
49+
50+CREATE INDEX ocirecipejob__recipe__job_type__job__idx
51+ ON OCIRecipeJob(recipe, job_type, job);
52+
53+COMMENT ON TABLE OCIRecipeJob IS 'Contains references to jobs that are executed for an OCI Recipe.';
54+COMMENT ON COLUMN OCIRecipeJob.job IS 'A reference to a Job row that has all the common job details.';
55+COMMENT ON COLUMN OCIRecipeJob.recipe IS 'The OCI recipe that this job is for.';
56+COMMENT ON COLUMN OCIRecipeJob.job_type IS 'The type of a job, such as a build request.';
57+COMMENT ON COLUMN OCIRecipeJob.json_data IS 'Data that is specific to a particular job type.';
58+
59+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 15, 0);
60diff --git a/database/schema/security.cfg b/database/schema/security.cfg
61index 55226e1..d36a542 100644
62--- a/database/schema/security.cfg
63+++ b/database/schema/security.cfg
64@@ -250,6 +250,7 @@ public.ocirecipe = SELECT, INSERT, UPDATE, DELETE
65 public.ocirecipearch = SELECT, INSERT, DELETE
66 public.ocirecipebuild = SELECT, INSERT, UPDATE, DELETE
67 public.ocirecipebuildjob = SELECT, INSERT, UPDATE, DELETE
68+public.ocirecipejob = SELECT, INSERT, UPDATE, DELETE
69 public.ociregistrycredentials = SELECT, INSERT, UPDATE, DELETE
70 public.officialbugtag = SELECT, INSERT, UPDATE, DELETE
71 public.openidconsumerassociation = SELECT, INSERT, UPDATE, DELETE

Subscribers

People subscribed via source and target branches

to status/vote changes: