bug 8812: DB upgrade (2.1 - 2.2) changes for template. ant unittest successful

status 8812: resolved fixed
This commit is contained in:
nit 2011-03-02 13:39:03 -08:00
parent c1132d5d20
commit e772bfa00b
1 changed files with 5 additions and 1 deletions

6
setup/db/schema-21to22.sql Normal file → Executable file
View File

@ -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;