Merge lp:~wgrant/launchpad/processor-nonvirt-db into lp:launchpad/db-devel

Proposed by William Grant
Status: Merged
Merged at revision: 13044
Proposed branch: lp:~wgrant/launchpad/processor-nonvirt-db
Merge into: lp:launchpad/db-devel
Diff against target: 59 lines (+27/-6)
3 files modified
database/sampledata/current-dev.sql (+3/-3)
database/sampledata/current.sql (+3/-3)
database/schema/patch-2209-64-0.sql (+21/-0)
To merge this branch: bzr merge lp:~wgrant/launchpad/processor-nonvirt-db
Reviewer Review Type Date Requested Status
Colin Watson (community) db Approve
Review via email: mp+259095@code.launchpad.net

Commit message

Add Processor.{supports_{non,}virtualized,build_by_default} and set them sensibly for existing rows.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve (db)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'database/sampledata/current-dev.sql'
2--- database/sampledata/current-dev.sql 2015-04-20 14:02:12 +0000
3+++ database/sampledata/current-dev.sql 2015-05-14 09:38:31 +0000
4@@ -972,9 +972,9 @@
5
6 ALTER TABLE processor DISABLE TRIGGER ALL;
7
8-INSERT INTO processor (id, name, title, description, restricted) VALUES (1, '386', 'Intel 386', 'Intel 386 and its many derivatives and clones, the basic 32-bit chip in the x86 family', false);
9-INSERT INTO processor (id, name, title, description, restricted) VALUES (2, 'amd64', 'AMD 64bit', 'AMD 64bit', false);
10-INSERT INTO processor (id, name, title, description, restricted) VALUES (3, 'hppa', 'HPPA Processor', 'HPPA Processor', false);
11+INSERT INTO processor (id, name, title, description, restricted, build_by_default, supports_nonvirtualized, supports_virtualized) VALUES (1, '386', 'Intel 386', 'Intel 386 and its many derivatives and clones, the basic 32-bit chip in the x86 family', false, true, true, true);
12+INSERT INTO processor (id, name, title, description, restricted, build_by_default, supports_nonvirtualized, supports_virtualized) VALUES (2, 'amd64', 'AMD 64bit', 'AMD 64bit', false, true, true, true);
13+INSERT INTO processor (id, name, title, description, restricted, build_by_default, supports_nonvirtualized, supports_virtualized) VALUES (3, 'hppa', 'HPPA Processor', 'HPPA Processor', false, false, true, false);
14
15
16 ALTER TABLE processor ENABLE TRIGGER ALL;
17
18=== modified file 'database/sampledata/current.sql'
19--- database/sampledata/current.sql 2015-04-20 14:02:12 +0000
20+++ database/sampledata/current.sql 2015-05-14 09:38:31 +0000
21@@ -972,9 +972,9 @@
22
23 ALTER TABLE processor DISABLE TRIGGER ALL;
24
25-INSERT INTO processor (id, name, title, description, restricted) VALUES (1, '386', 'Intel 386', 'Intel 386 and its many derivatives and clones, the basic 32-bit chip in the x86 family', false);
26-INSERT INTO processor (id, name, title, description, restricted) VALUES (2, 'amd64', 'AMD 64bit', 'AMD 64bit', false);
27-INSERT INTO processor (id, name, title, description, restricted) VALUES (3, 'hppa', 'HPPA Processor', 'HPPA Processor', false);
28+INSERT INTO processor (id, name, title, description, restricted, build_by_default, supports_nonvirtualized, supports_virtualized) VALUES (1, '386', 'Intel 386', 'Intel 386 and its many derivatives and clones, the basic 32-bit chip in the x86 family', false, true, true, true);
29+INSERT INTO processor (id, name, title, description, restricted, build_by_default, supports_nonvirtualized, supports_virtualized) VALUES (2, 'amd64', 'AMD 64bit', 'AMD 64bit', false, true, true, true);
30+INSERT INTO processor (id, name, title, description, restricted, build_by_default, supports_nonvirtualized, supports_virtualized) VALUES (3, 'hppa', 'HPPA Processor', 'HPPA Processor', false, false, true, false);
31
32
33 ALTER TABLE processor ENABLE TRIGGER ALL;
34
35=== added file 'database/schema/patch-2209-64-0.sql'
36--- database/schema/patch-2209-64-0.sql 1970-01-01 00:00:00 +0000
37+++ database/schema/patch-2209-64-0.sql 2015-05-14 09:38:31 +0000
38@@ -0,0 +1,21 @@
39+-- Copyright 2015 Canonical Ltd. This software is licensed under the
40+-- GNU Affero General Public License version 3 (see the file LICENSE).
41+
42+SET client_min_messages=ERROR;
43+
44+ALTER TABLE Processor
45+ ADD COLUMN build_by_default boolean DEFAULT false NOT NULL,
46+ ADD COLUMN supports_nonvirtualized boolean DEFAULT true NOT NULL,
47+ ADD COLUMN supports_virtualized boolean DEFAULT false NOT NULL;
48+
49+ALTER TABLE Processor
50+ ADD CONSTRAINT restricted_not_default
51+ CHECK (NOT restricted OR NOT build_by_default);
52+
53+UPDATE processor SET supports_virtualized = true
54+ WHERE name IN ('i386', 'amd64', 'arm64', 'armhf', 'lpia', '386');
55+
56+UPDATE processor SET build_by_default = true
57+ WHERE name IN ('i386', 'amd64', 'lpia', '386');
58+
59+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 64, 0);

Subscribers

People subscribed via source and target branches

to status/vote changes: