← Back to team overview

launchpad-reviewers team mailing list archive

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

 

William Grant has proposed merging lp:~wgrant/launchpad/processor-nonvirt-db into lp:launchpad/db-devel.

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

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/processor-nonvirt-db/+merge/259095
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/processor-nonvirt-db into lp:launchpad/db-devel.
=== modified file 'database/sampledata/current-dev.sql'
--- database/sampledata/current-dev.sql	2015-04-20 14:02:12 +0000
+++ database/sampledata/current-dev.sql	2015-05-14 09:38:31 +0000
@@ -972,9 +972,9 @@
 
 ALTER TABLE processor DISABLE TRIGGER ALL;
 
-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);
-INSERT INTO processor (id, name, title, description, restricted) VALUES (2, 'amd64', 'AMD 64bit', 'AMD 64bit', false);
-INSERT INTO processor (id, name, title, description, restricted) VALUES (3, 'hppa', 'HPPA Processor', 'HPPA Processor', false);
+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);
+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);
+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);
 
 
 ALTER TABLE processor ENABLE TRIGGER ALL;

=== modified file 'database/sampledata/current.sql'
--- database/sampledata/current.sql	2015-04-20 14:02:12 +0000
+++ database/sampledata/current.sql	2015-05-14 09:38:31 +0000
@@ -972,9 +972,9 @@
 
 ALTER TABLE processor DISABLE TRIGGER ALL;
 
-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);
-INSERT INTO processor (id, name, title, description, restricted) VALUES (2, 'amd64', 'AMD 64bit', 'AMD 64bit', false);
-INSERT INTO processor (id, name, title, description, restricted) VALUES (3, 'hppa', 'HPPA Processor', 'HPPA Processor', false);
+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);
+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);
+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);
 
 
 ALTER TABLE processor ENABLE TRIGGER ALL;

=== added file 'database/schema/patch-2209-64-0.sql'
--- database/schema/patch-2209-64-0.sql	1970-01-01 00:00:00 +0000
+++ database/schema/patch-2209-64-0.sql	2015-05-14 09:38:31 +0000
@@ -0,0 +1,21 @@
+-- Copyright 2015 Canonical Ltd.  This software is licensed under the
+-- GNU Affero General Public License version 3 (see the file LICENSE).
+
+SET client_min_messages=ERROR;
+
+ALTER TABLE Processor
+    ADD COLUMN build_by_default boolean DEFAULT false NOT NULL,
+    ADD COLUMN supports_nonvirtualized boolean DEFAULT true NOT NULL,
+    ADD COLUMN supports_virtualized boolean DEFAULT false NOT NULL;
+
+ALTER TABLE Processor
+    ADD CONSTRAINT restricted_not_default
+        CHECK (NOT restricted OR NOT build_by_default);
+
+UPDATE processor SET supports_virtualized = true
+    WHERE name IN ('i386', 'amd64', 'arm64', 'armhf', 'lpia', '386');
+
+UPDATE processor SET build_by_default = true
+    WHERE name IN ('i386', 'amd64', 'lpia', '386');
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 64, 0);