Merge lp:~cjwatson/launchpad/db-snap-preferred-series into lp:launchpad/db-devel

Proposed by Colin Watson
Status: Merged
Merged at revision: 13603
Proposed branch: lp:~cjwatson/launchpad/db-snap-preferred-series
Merge into: lp:launchpad/db-devel
Diff against target: 16 lines (+12/-0)
1 file modified
database/schema/patch-2209-69-6.sql (+12/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad/db-snap-preferred-series
Reviewer Review Type Date Requested Status
William Grant db Approve
Review via email: mp+310215@code.launchpad.net

Commit message

Add SnappyDistroSeries.preferred column.

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

Is this just snappydistroseries.preferred, with UNIQUE snappydistroseries (snappy_series) WHERE preferred?

review: Needs Fixing (db)
Revision history for this message
Colin Watson (cjwatson) wrote :

That makes the code rather more complicated, but on the other hand it does a better job of encoding the constraint that the preferred distroseries must be usable, so I guess that's a win. I've rearranged this and the corresponding code branch accordingly.

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-69-6.sql'
2--- database/schema/patch-2209-69-6.sql 1970-01-01 00:00:00 +0000
3+++ database/schema/patch-2209-69-6.sql 2016-11-08 16:47:32 +0000
4@@ -0,0 +1,12 @@
5+-- Copyright 2016 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+ALTER TABLE SnappyDistroSeries ADD COLUMN preferred boolean DEFAULT false NOT NULL;
11+
12+CREATE UNIQUE INDEX snappydistroseries__snappy_series__preferred__idx ON SnappyDistroSeries (snappy_series) WHERE preferred;
13+
14+COMMENT ON COLUMN SnappyDistroSeries.preferred IS 'True if this record identifies the default distribution series for builds for this snappy series.';
15+
16+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 69, 6);

Subscribers

People subscribed via source and target branches

to status/vote changes: