From 0569b5176419d1e12d105a69dc6cba10554dee0d Mon Sep 17 00:00:00 2001 From: keshav Date: Fri, 16 Sep 2011 10:15:31 -0700 Subject: [PATCH] Added inline load balancer nic map table to 2.2.11 -> 2.2.12 upgrade script. --- setup/db/db/schema-2211to2212.sql | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/setup/db/db/schema-2211to2212.sql b/setup/db/db/schema-2211to2212.sql index 6266d2d7a34..0af4b8a1549 100644 --- a/setup/db/db/schema-2211to2212.sql +++ b/setup/db/db/schema-2211to2212.sql @@ -12,10 +12,10 @@ INSERT IGNORE INTO configuration VALUES ('Premium', 'DEFAULT', 'management-serve ALTER IGNORE TABLE `cloud`.`user_vm_details` DROP FOREIGN KEY `fk_user_vm_details__vm_id`; ALTER TABLE `cloud`.`user_vm_details` ADD CONSTRAINT `fk_user_vm_details__vm_id` FOREIGN KEY `fk_user_vm_details__vm_id`(`vm_id`) REFERENCES `vm_instance`(`id`) ON DELETE CASCADE; - -ALTER TABLE `cloud`.`domain_router` ADD COLUMN `is_priority_bumpup` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'if the priority has been bumped up'; -ALTER TABLE `cloud`.`domain_router` ADD COLUMN `stop_pending` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'if this router would be stopped after we can connect to it'; - + +ALTER TABLE `cloud`.`domain_router` ADD COLUMN `is_priority_bumpup` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'if the priority has been bumped up'; +ALTER TABLE `cloud`.`domain_router` ADD COLUMN `stop_pending` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'if this router would be stopped after we can connect to it'; + DELETE FROM `cloud`.`configuration` where name='vmware.guest.nic.device.type'; INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'agent.lb.enabled', 'true', 'If agent load balancing enabled in cluster setup'); @@ -28,3 +28,15 @@ ALTER TABLE `cloud`.`resource_count` ADD UNIQUE `i_resource_count__type_accountI ALTER TABLE `cloud`.`resource_count` ADD UNIQUE `i_resource_count__type_domaintId`(`type`, `domain_id`); UPDATE configuration set description='Load Balancer(haproxy) stats visibilty, the value can be one of the following six parameters : global,guest-network,link-local,disabled,all,default' WHERE name='network.loadbalancer.haproxy.stats.visibility' ; + +CREATE TABLE IF NOT EXISTS `cloud`.`inline_load_balancer_nic_map` ( + `id` bigint unsigned NOT NULL auto_increment, + `load_balancer_id` bigint unsigned NOT NULL, + `public_ip_address` char(40) NOT NULL, + `nic_id` bigint unsigned NULL COMMENT 'nic id', + PRIMARY KEY (`id`), + UNIQUE KEY (`nic_id`), + CONSTRAINT `fk_inline_load_balancer_nic_map__load_balancer_id` FOREIGN KEY(`load_balancer_id`) REFERENCES `load_balancing_rules`(`id`) ON DELETE CASCADE, + CONSTRAINT `fk_inline_load_balancer_nic_map__nic_id` FOREIGN KEY(`nic_id`) REFERENCES `nics`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +