From ef5f0f56430059a4422d20b8e2eacb0897e55290 Mon Sep 17 00:00:00 2001 From: alena Date: Wed, 8 Jun 2011 14:56:20 -0700 Subject: [PATCH] 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 --- setup/db/db/schema-21to22.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup/db/db/schema-21to22.sql b/setup/db/db/schema-21to22.sql index 697461c07bb..5d69f487bcd 100755 --- a/setup/db/db/schema-21to22.sql +++ b/setup/db/db/schema-21to22.sql @@ -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); +