Skip to content

Commit 54f7933

Browse files
committed
CLOUDSTACK-1355: Don't check foreign key constraint during db upgrades
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
1 parent 5f8a2ee commit 54f7933

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

setup/db/db/schema-40to410.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
--;
2121

2222
use cloud;
23+
SET foreign_key_checks = 0;
2324

2425
alter table vm_template add size bigint unsigned;
2526
alter table vm_template add state varchar(255);
@@ -1653,3 +1654,5 @@ CREATE TABLE `cloud`.`baremetal_pxe_devices` (
16531654
`host_id` bigint unsigned DEFAULT NULL COMMENT 'host id coresponding to the external pxe device',
16541655
PRIMARY KEY (`id`)
16551656
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1657+
1658+
SET foreign_key_checks = 1;

setup/db/db/schema-410to420.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
-- Schema upgrade from 4.1.0 to 4.2.0;
2020
--;
2121

22+
SET foreign_key_checks = 0;
2223

2324
ALTER TABLE `cloud`.`hypervisor_capabilities` ADD COLUMN `max_hosts_per_cluster` int unsigned DEFAULT NULL COMMENT 'Max. hosts in cluster supported by hypervisor';
2425
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
8182

8283
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.';
8384
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';
85+
86+
SET foreign_key_checks = 1;
87+

0 commit comments

Comments
 (0)