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

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 66921f2f68afa96b09cde7ecb04610b4c8417982
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: 27 lines (+21/-0)
1 file modified
database/schema/patch-2210-30-0.sql (+21/-0)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+400541@code.launchpad.net

Commit message

Merge db-stable 66921f2f68 (Add ArchiveDependency.snap_base and SnapBuild.snap_base)

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-30-0.sql b/database/schema/patch-2210-30-0.sql
2new file mode 100644
3index 0000000..c7190e9
4--- /dev/null
5+++ b/database/schema/patch-2210-30-0.sql
6@@ -0,0 +1,21 @@
7+-- Copyright 2021 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 ArchiveDependency
13+ ADD COLUMN snap_base integer REFERENCES snapbase,
14+ ALTER COLUMN archive DROP NOT NULL,
15+ ADD CONSTRAINT one_parent CHECK (null_count(ARRAY[archive, snap_base]) = 1);
16+
17+CREATE INDEX archivedependency__snap_base__idx
18+ ON ArchiveDependency (snap_base);
19+
20+COMMENT ON TABLE ArchiveDependency IS 'This table maps a given parent (archive or snap base) to all other archives it should depend on.';
21+COMMENT ON COLUMN ArchiveDependency.snap_base IS 'The snap base that has this dependency.';
22+
23+ALTER TABLE SnapBuild ADD COLUMN snap_base integer REFERENCES snapbase;
24+
25+COMMENT ON COLUMN SnapBuild.snap_base IS 'The snap base to use for this build.';
26+
27+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 30, 0);

Subscribers

People subscribed via source and target branches

to status/vote changes: