Merge ~cjwatson/launchpad:db-oci-recipe-build-build-request into launchpad:db-devel

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: d70c0fd4bccf395b93b224714acf2b3bbf348c57
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:db-oci-recipe-build-build-request
Merge into: launchpad:db-devel
Diff against target: 18 lines (+12/-0)
1 file modified
database/schema/patch-2210-15-1.sql (+12/-0)
Reviewer Review Type Date Requested Status
William Grant db Approve
Review via email: mp+383021@code.launchpad.net

Commit message

Add OCIRecipeBuild.build_request column

Description of the change

This is useful in order to be able to trace builds back to the build request that produced them. It's precisely analogous to SnapBuild.build_request (see DB patch 2209-83-4).

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (db)
Revision history for this message
William Grant (wgrant) wrote :

This needs an index.

d70c0fd... by Colin Watson

Index OCIRecipeBuild (build_request)

Revision history for this message
William Grant (wgrant) :
review: Approve (db)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/database/schema/patch-2210-15-1.sql b/database/schema/patch-2210-15-1.sql
2new file mode 100644
3index 0000000..86197e1
4--- /dev/null
5+++ b/database/schema/patch-2210-15-1.sql
6@@ -0,0 +1,12 @@
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+ALTER TABLE OCIRecipeBuild ADD COLUMN build_request integer REFERENCES job;
13+
14+COMMENT ON COLUMN OCIRecipeBuild.build_request IS 'The build request that caused this build to be created.';
15+
16+CREATE INDEX ocirecipebuild__build_request__idx ON OCIRecipeBuild (build_request);
17+
18+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 15, 1);

Subscribers

People subscribed via source and target branches

to status/vote changes: