Merge ~cjwatson/launchpad:db-snap-base-arch into launchpad:db-devel

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 03626c364ee6104273b43390aaf6ebb7f6417e94
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:db-snap-base-arch
Merge into: launchpad:db-devel
Diff against target: 29 lines (+23/-0)
1 file modified
database/schema/patch-2210-30-1.sql (+23/-0)
Reviewer Review Type Date Requested Status
William Grant db Approve
Cristian Gonzalez (community) Approve
Review via email: mp+402532@code.launchpad.net

Commit message

Add SnapBaseArch table

Description of the change

A snap base may not support all the architectures supported by its underlying distroseries: in particular, core20 does not support i386. Extend the model to allow us to support this cleanly.

To post a comment you must log in.
Revision history for this message
Cristian Gonzalez (cristiangsp) wrote :

Looks good! (and also helped me understand the connection between snap bases and distribution series)

review: Approve
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
diff --git a/database/schema/patch-2210-30-1.sql b/database/schema/patch-2210-30-1.sql
0new file mode 1006440new file mode 100644
index 0000000..ea50782
--- /dev/null
+++ b/database/schema/patch-2210-30-1.sql
@@ -0,0 +1,23 @@
1-- Copyright 2021 Canonical Ltd. This software is licensed under the
2-- GNU Affero General Public License version 3 (see the file LICENSE).
3
4CREATE TABLE SnapBaseArch (
5 snap_base integer NOT NULL REFERENCES snapbase,
6 processor integer NOT NULL REFERENCES processor,
7 PRIMARY KEY (snap_base, processor)
8);
9
10COMMENT ON TABLE SnapBaseArch IS 'The architectures that a snap base supports.';
11COMMENT ON COLUMN SnapBaseArch.snap_base IS 'The snap base for which a supported architecture is specified.';
12COMMENT ON COLUMN SnapBaseArch.processor IS 'A supported architecture for this snap base.';
13
14-- Initialize with all possibilities for each corresponding distroseries,
15-- preserving previous behaviour.
16INSERT INTO SnapBaseArch (snap_base, processor)
17 SELECT SnapBase.id, DistroArchSeries.processor
18 FROM SnapBase, DistroArchSeries
19 WHERE
20 SnapBase.distro_series = DistroArchSeries.distroseries
21 AND DistroArchSeries.enabled;
22
23INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 30, 1);

Subscribers

People subscribed via source and target branches

to status/vote changes: