From 54f7933f113841e9d17a420c40d6ff2203c43290 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Fri, 22 Feb 2013 19:28:07 +0530 Subject: [PATCH] CLOUDSTACK-1355: Don't check foreign key constraint during db upgrades Signed-off-by: Rohit Yadav --- setup/db/db/schema-40to410.sql | 3 +++ setup/db/db/schema-410to420.sql | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/setup/db/db/schema-40to410.sql b/setup/db/db/schema-40to410.sql index 1758d84b185..74f0dba08ee 100644 --- a/setup/db/db/schema-40to410.sql +++ b/setup/db/db/schema-40to410.sql @@ -20,6 +20,7 @@ --; use cloud; +SET foreign_key_checks = 0; alter table vm_template add size bigint unsigned; alter table vm_template add state varchar(255); @@ -1653,3 +1654,5 @@ CREATE TABLE `cloud`.`baremetal_pxe_devices` ( `host_id` bigint unsigned DEFAULT NULL COMMENT 'host id coresponding to the external pxe device', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +SET foreign_key_checks = 1; diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql index fd96d31e534..4637b6df951 100644 --- a/setup/db/db/schema-410to420.sql +++ b/setup/db/db/schema-410to420.sql @@ -19,6 +19,7 @@ -- Schema upgrade from 4.1.0 to 4.2.0; --; +SET foreign_key_checks = 0; ALTER TABLE `cloud`.`hypervisor_capabilities` ADD COLUMN `max_hosts_per_cluster` int unsigned DEFAULT NULL COMMENT 'Max. hosts in cluster supported by hypervisor'; UPDATE `cloud`.`hypervisor_capabilities` SET `max_hosts_per_cluster`=32 WHERE `hypervisor_type`='VMware'; @@ -81,3 +82,6 @@ ALTER TABLE `cloud`.`service_offering` ADD COLUMN `is_volatile` tinyint(1) unsig ALTER TABLE `cloud`.`networks` ADD COLUMN `network_cidr` VARCHAR(18) COMMENT 'The network cidr for the isolated guest network which uses IP Reservation facility.For networks not using IP reservation, network_cidr is always null.'; ALTER TABLE `cloud`.`networks` CHANGE `cidr` `cidr` varchar(18) COMMENT 'CloudStack managed vms get IP address from cidr.In general this cidr also serves as the network CIDR. But in case IP reservation feature is being used by a Guest network, networkcidr is the Effective network CIDR for that network'; + +SET foreign_key_checks = 1; +