cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject git commit: updated refs/heads/4.5 to cb43f25
Date Tue, 14 Apr 2015 09:23:27 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.5 5f154b91b -> cb43f2544


disable foreign key checks when altering them

Upgrades from 4.4 where not working properly due to errors like this:
ERROR 1833 (HY000): Cannot change column 'id': used in a foreign key constraint 'fk_global_load_balancing_rules_region_id'
of table 'cloud.global_load_balancing_rules'

The disabling of the checks is for the current session only, so it's safe.

In the 4.4 branch, this file used to be at:
client/target/utilities/scripts/db/db/schema-442to450.sql

It's now moved. We need to edit it in 4.4 and 4.5 to have it effective.

This closes #164

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 8f4abbc7bd65e7a7cad67ba64b29d745aa0869c0)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/cb43f254
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/cb43f254
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/cb43f254

Branch: refs/heads/4.5
Commit: cb43f25446c2013374fd62f7cea2454b584efbe4
Parents: 5f154b9
Author: Remi Bergsma <github@remi.nl>
Authored: Mon Apr 13 16:38:17 2015 -0500
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Tue Apr 14 14:53:12 2015 +0530

----------------------------------------------------------------------
 setup/db/db/schema-442to450.sql | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cb43f254/setup/db/db/schema-442to450.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-442to450.sql b/setup/db/db/schema-442to450.sql
index 4a8f250..774eee5 100644
--- a/setup/db/db/schema-442to450.sql
+++ b/setup/db/db/schema-442to450.sql
@@ -37,6 +37,7 @@ ALTER TABLE `cloud`.`volumes` ADD COLUMN `provisioning_type` VARCHAR(32)
NOT NUL
 ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `provisioning_type` VARCHAR(32) NOT NULL DEFAULT
'thin' COMMENT 'pre allocation setting of the volume';
 
 -- Have primary keys of following table AUTO_INCREMENT
+SET foreign_key_checks = 0;
 ALTER TABLE `cloud`.`region` MODIFY `id` int unsigned AUTO_INCREMENT UNIQUE NOT NULL;
 ALTER TABLE `cloud`.`vm_instance` MODIFY `id` bigint unsigned AUTO_INCREMENT UNIQUE NOT NULL;
 ALTER TABLE `cloud`.`user_vm` MODIFY `id` bigint unsigned AUTO_INCREMENT UNIQUE NOT NULL;
@@ -44,6 +45,7 @@ ALTER TABLE `cloud`.`domain_router` MODIFY `id` bigint unsigned AUTO_INCREMENT
U
 ALTER TABLE `cloud`.`service_offering` MODIFY `id` bigint unsigned AUTO_INCREMENT NOT NULL;
 ALTER TABLE `cloud`.`load_balancing_rules` MODIFY `id` bigint unsigned AUTO_INCREMENT NOT
NULL;
 ALTER TABLE `cloud`.`port_forwarding_rules` MODIFY `id` bigint unsigned AUTO_INCREMENT NOT
NULL;
+SET foreign_key_checks = 1;
 
 DROP VIEW IF EXISTS `cloud`.`disk_offering_view`;
 CREATE VIEW `cloud`.`disk_offering_view` AS


Mime
View raw message