Handle 2.1.x bugs when do 21x to 22x DB upgrade:

* remove records from load_balancer_vm_map if the parent record is missing in load_balancer table
* remove user vm records from vm_instance table when corresponding record is missing in user_vm table
This commit is contained in:
alena 2011-06-08 14:56:20 -07:00
parent f81ddc1f7b
commit ef5f0f5643
1 changed files with 3 additions and 0 deletions

View File

@ -997,3 +997,6 @@ ALTER TABLE `cloud`.`user_ip_address` ADD CONSTRAINT `fk_user_ip_address__data_c
INSERT INTO configuration (category, instance, component, name, value, description)
VALUES ('Advanced', 'DEFAULT', 'management-server', 'hypervisor.list', 'KVM,XenServer,VMware', 'The list of hypervisors that this deployment will use.');
DELETE FROM load_balancer_vm_map WHERE load_balancer_id NOT IN (SELECT id FROM load_balancer);
DELETE FROM vm_instance WHERE type='User' AND id NOT IN (SELECT id FROM user_vm);