From 5c23adfff2f103f419dbeedd04e895d2d835d4c8 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Tue, 6 Aug 2013 14:44:15 +0200 Subject: [PATCH] CLOUDSTACK-4110: update user_ip_address.dnat_vmip field in 410to420 upgrade (cherry picked from commit fa094a5d2c9e0274c3dd9c10e3c5ed4df81b67bc) --- setup/db/db/schema-410to420.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql index 1ca9d647025..797a931f603 100644 --- a/setup/db/db/schema-410to420.sql +++ b/setup/db/db/schema-410to420.sql @@ -423,6 +423,8 @@ CREATE TABLE nic_secondary_ips ( ALTER TABLE `cloud`.`nics` ADD COLUMN secondary_ip SMALLINT DEFAULT '0' COMMENT 'secondary ips configured for the nic'; ALTER TABLE `cloud`.`user_ip_address` ADD COLUMN dnat_vmip VARCHAR(40); +UPDATE `cloud`.`user_ip_address`,`cloud`.`nics` SET `user_ip_address`.`dnat_vmip` = `nics`.`ip4_address` + WHERE `user_ip_address`.`vm_id` = `nics`.`instance_id` AND `user_ip_address`.`network_id` = `nics`.`network_id` AND `user_ip_address`.`one_to_one_nat` = 1; ALTER TABLE `cloud`.`alert` ADD COLUMN `archived` tinyint(1) unsigned NOT NULL DEFAULT 0; ALTER TABLE `cloud`.`event` ADD COLUMN `archived` tinyint(1) unsigned NOT NULL DEFAULT 0;