Database upgrade from 222 to 224 for Bug 6873 - disable/enable mode for clusters (and pods and zones and hosts)

- Adding column and index 'allocation_state' to clusters and pods and zones and hosts
This commit is contained in:
prachi 2011-03-29 11:05:05 -07:00
parent 0ed810824c
commit e87ffdec3e
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,5 @@
ALTER TABLE `cloud`.`account_vlan_map` DROP FOREIGN KEY `fk_account_vlan_map__domain_id`;
ALTER TABLE `cloud`.`account_vlan_map` DROP COLUMN `domain_id`;
DELETE FROM `cloud`.`account_vlan_map` WHERE account_id IS NULL;
ALTER TABLE `cloud`.`data_center` DROP COLUMN `enable`;
ALTER TABLE `cloud`.`host_pod_ref` DROP COLUMN `enabled`;

View File

@ -50,4 +50,11 @@ INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (138, 7, '
UPDATE `cloud`.`network_offerings` SET `nw_rate`=0, `mc_rate`=0 WHERE system_only=1 and guest_type IS NULL;
UPDATE `cloud`.`network_offerings` SET `default`=1 WHERE system_only=1;
ALTER TABLE `cloud`.`data_center` ADD COLUMN `allocation_state` varchar(32) NOT NULL DEFAULT 'Enabled';
ALTER TABLE `cloud`.`data_center` ADD INDEX `i_data_center__allocation_state`(`allocation_state`);
ALTER TABLE `cloud`.`cluster` ADD COLUMN `allocation_state` varchar(32) NOT NULL DEFAULT 'Enabled';
ALTER TABLE `cloud`.`cluster` ADD INDEX `i_cluster__allocation_state`(`allocation_state`);
ALTER TABLE `cloud`.`host_pod_ref` ADD COLUMN `allocation_state` varchar(32) NOT NULL DEFAULT 'Enabled';
ALTER TABLE `cloud`.`host_pod_ref` ADD INDEX `i_host_pod_ref__allocation_state`(`allocation_state`);
ALTER TABLE `cloud`.`host` ADD COLUMN `allocation_state` varchar(32) NOT NULL DEFAULT 'Enabled';
ALTER TABLE `cloud`.`host` ADD INDEX `i_host__allocation_state`(`allocation_state`);