Merge lp:~cjwatson/launchpad/db-pocket-chroot-image-type into lp:launchpad/db-devel

Proposed by Colin Watson
Status: Merged
Merged at revision: 14011
Proposed branch: lp:~cjwatson/launchpad/db-pocket-chroot-image-type
Merge into: lp:launchpad/db-devel
Diff against target: 19 lines (+15/-0)
1 file modified
database/schema/patch-2209-86-0.sql (+15/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad/db-pocket-chroot-image-type
Reviewer Review Type Date Requested Status
William Grant db Approve
Stuart Bishop db Pending
Review via email: mp+361733@code.launchpad.net

Commit message

Add PocketChroot.image_type column.

Description of the change

There are only 168 rows in PocketChroot on production, so I don't think it's worth populating the new column separately; we can just do it in DDL.

To post a comment you must log in.
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
1=== added file 'database/schema/patch-2209-86-0.sql'
2--- database/schema/patch-2209-86-0.sql 1970-01-01 00:00:00 +0000
3+++ database/schema/patch-2209-86-0.sql 2019-01-14 13:40:57 +0000
4@@ -0,0 +1,15 @@
5+-- Copyright 2019 Canonical Ltd. This software is licensed under the
6+-- GNU Affero General Public License version 3 (see the file LICENSE).
7+
8+SET client_min_messages=ERROR;
9+
10+-- 0 == CHROOT
11+ALTER TABLE PocketChroot
12+ ADD COLUMN image_type integer DEFAULT 0 NOT NULL,
13+ ADD CONSTRAINT pocketchroot__distroarchseries__pocket__image_type__key
14+ UNIQUE (distroarchseries, pocket, image_type),
15+ DROP CONSTRAINT pocketchroot_distroarchrelease_key;
16+
17+COMMENT ON COLUMN PocketChroot.image_type IS 'The type of this image.';
18+
19+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 86, 0);

Subscribers

People subscribed via source and target branches

to status/vote changes: