CLOUDSTACK-1355: Don't check foreign key constraint during db upgrades Signed-off-by: Rohit Yadav <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/54f7933f Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/54f7933f Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/54f7933f Branch: refs/heads/qemu-img Commit: 54f7933f113841e9d17a420c40d6ff2203c43290 Parents: 5f8a2ee Author: Rohit Yadav <[email protected]> Authored: Fri Feb 22 19:28:07 2013 +0530 Committer: Rohit Yadav <[email protected]> Committed: Fri Feb 22 19:28:07 2013 +0530 ---------------------------------------------------------------------- setup/db/db/schema-40to410.sql | 3 +++ setup/db/db/schema-410to420.sql | 4 ++++ 2 files changed, 7 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/54f7933f/setup/db/db/schema-40to410.sql ---------------------------------------------------------------------- diff --git a/setup/db/db/schema-40to410.sql b/setup/db/db/schema-40to410.sql index 1758d84..74f0dba 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; http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/54f7933f/setup/db/db/schema-410to420.sql ---------------------------------------------------------------------- diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql index fd96d31..4637b6d 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; +
