From e772bfa00b4d68cc35189b3b8f9a10b5c0270b8e Mon Sep 17 00:00:00 2001 From: nit Date: Wed, 2 Mar 2011 13:39:03 -0800 Subject: [PATCH] bug 8812: DB upgrade (2.1 - 2.2) changes for template. ant unittest successful status 8812: resolved fixed --- setup/db/schema-21to22.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) mode change 100644 => 100755 setup/db/schema-21to22.sql diff --git a/setup/db/schema-21to22.sql b/setup/db/schema-21to22.sql old mode 100644 new mode 100755 index 23d6801465c..68aa573e45e --- a/setup/db/schema-21to22.sql +++ b/setup/db/schema-21to22.sql @@ -1,10 +1,14 @@ --; -- Schema upgrade from 2.1 to 2.2; --; -ALTER TABLE `cloud`.`template_host_ref` ADD COLUMN `physical_size` bigint unsigned NOT NULL DEFAULT 0; + ALTER TABLE `cloud`.`vm_instance` DROP COLUMN `group`; ALTER TABLE `cloud`.`cluster` ADD COLUMN `guid` varchar(255) UNIQUE DEFAULT NULL; ALTER TABLE `cloud`.`cluster` ADD COLUMN `cluster_type` varchar(64) DEFAULT 'CloudManaged'; +ALTER TABLE `cloud`.`vm_template` ADD COLUMN `hypervisor_type` varchar(32) COMMENT 'hypervisor that the template is belonged to'; +ALTER TABLE `cloud`.`vm_template` ADD COLUMN `extractable` int(1) unsigned NOT NULL default 0 COMMENT 'Is this template extractable'; +ALTER TABLE `cloud`.`template_spool_ref` ADD CONSTRAINT `fk_template_spool_ref__template_id` FOREIGN KEY (`template_id`) REFERENCES `vm_template`(`id`); +ALTER TABLE `cloud`.`template_spool_ref` ADD CONSTRAINT `fk_template_spool_ref__pool_id` FOREIGN KEY (`pool_id`) REFERENCES `storage_pool`(`id`) ON DELETE CASCADE; -- NOTE for tables below; -- these 2 tables were used in 2.1, but are not in 2.2;