You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2018/04/20 13:28:14 UTC
[GitHub] rhtyd closed pull request #2582: cs-45to411-ugrade-fix: database
errors during upgrade to 4.11
rhtyd closed pull request #2582: cs-45to411-ugrade-fix: database errors during upgrade to 4.11
URL: https://github.com/apache/cloudstack/pull/2582
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/engine/schema/resources/META-INF/db/schema-41000to41100.sql b/engine/schema/resources/META-INF/db/schema-41000to41100.sql
index 4dc11d448fc..b3efce4cbbc 100644
--- a/engine/schema/resources/META-INF/db/schema-41000to41100.sql
+++ b/engine/schema/resources/META-INF/db/schema-41000to41100.sql
@@ -392,7 +392,7 @@ CREATE VIEW `cloud`.`volume_view` AS
`cloud`.`domain` resource_tag_domain ON resource_tag_domain.id = resource_tags.domain_id;
-- Extra Dhcp Options
-CREATE TABLE IF NOT EXISTS `cloud`.`nic_extra_dhcp_options` (
+CREATE TABLE IF NOT EXISTS `cloud`.`nic_extra_dhcp_options` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`uuid` varchar(255) UNIQUE,
`nic_id` bigint unsigned NOT NULL COMMENT ' nic id where dhcp options are applied',
@@ -427,8 +427,7 @@ INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervi
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) SELECT UUID(),'Xenserver', '7.2.0', guest_os_name, guest_os_id, utc_timestamp(), 0 FROM `cloud`.`guest_os_hypervisor` WHERE hypervisor_type='Xenserver' AND hypervisor_version='7.1.0' AND guest_os_id not in (1,2,3,4,56,101,56,58,93,94,50,51,87,88,89,90,91,92,26,27,28,29,40,41,42,43,44,45,96,97,107,108,109,110,151,152,153);
-- Add table to track primary storage in use for snapshots
-DROP TABLE IF EXISTS `cloud_usage`.`usage_snapshot_on_primary`;
-CREATE TABLE `cloud_usage`.`usage_snapshot_on_primary` (
+CREATE TABLE IF NOT EXISTS `cloud_usage`.`usage_snapshot_on_primary` (
`id` bigint(20) unsigned NOT NULL,
`zone_id` bigint(20) unsigned NOT NULL,
`account_id` bigint(20) unsigned NOT NULL,
diff --git a/engine/schema/resources/META-INF/db/schema-452to460.sql b/engine/schema/resources/META-INF/db/schema-452to460.sql
index 1989b6c00c2..ace22e4e0b8 100644
--- a/engine/schema/resources/META-INF/db/schema-452to460.sql
+++ b/engine/schema/resources/META-INF/db/schema-452to460.sql
@@ -385,8 +385,7 @@ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'Netwo
UPDATE IGNORE `cloud`.`configuration` SET `value`="PLAINTEXT" WHERE `name`="user.authenticators.exclude";
-DROP TABLE IF EXISTS `cloud`.`external_bigswitch_vns_devices`;
-CREATE TABLE `cloud`.`external_bigswitch_bcf_devices` (
+CREATE TABLE IF NOT EXISTS `cloud`.`external_bigswitch_bcf_devices` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`uuid` varchar(255) UNIQUE,
`physical_network_id` bigint unsigned NOT NULL COMMENT 'id of the physical network in to which bigswitch bcf device is added',
@@ -405,7 +404,7 @@ CREATE TABLE `cloud`.`external_bigswitch_bcf_devices` (
UPDATE `cloud`.`host` SET `resource`='com.cloud.hypervisor.xenserver.resource.XenServer600Resource' WHERE `resource`='com.cloud.hypervisor.xenserver.resource.XenServer602Resource';
-CREATE TABLE `cloud`.`ldap_trust_map` (
+CREATE TABLE IF NOT EXISTS `cloud`.`ldap_trust_map` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`domain_id` bigint unsigned NOT NULL,
`type` varchar(10) NOT NULL,
diff --git a/engine/schema/resources/META-INF/db/schema-4930to41000.sql b/engine/schema/resources/META-INF/db/schema-4930to41000.sql
index dbea77d5e33..dc0cd6d4d75 100644
--- a/engine/schema/resources/META-INF/db/schema-4930to41000.sql
+++ b/engine/schema/resources/META-INF/db/schema-4930to41000.sql
@@ -111,7 +111,7 @@ INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervi
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'CentOS 7.2', 274, now(), 0);
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid, hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(), 'KVM', 'default', 'Other PV Virtio-SCSI (64-bit)', 275, now(), 0);
-CREATE TABLE `cloud`.`vlan_details` (
+CREATE TABLE IF NOT EXISTS `cloud`.`vlan_details` (
`id` bigint unsigned NOT NULL auto_increment,
`vlan_id` bigint unsigned NOT NULL COMMENT 'vlan id',
`name` varchar(255) NOT NULL,
@@ -137,7 +137,7 @@ INSERT INTO `cloud`.`role_permissions` (`uuid`, `role_id`, `rule`, `permission`,
INSERT INTO `cloud`.`role_permissions` (`uuid`, `role_id`, `rule`, `permission`, `sort_order`) values (UUID(), 4, 'createSnapshotFromVMSnapshot', 'ALLOW', 260) ON DUPLICATE KEY UPDATE rule=rule;
-- Create table storage_pool_tags
-CREATE TABLE `cloud`.`storage_pool_tags` (
+CREATE TABLE IF NOT EXISTS `cloud`.`storage_pool_tags` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`pool_id` bigint(20) unsigned NOT NULL COMMENT "pool id",
`tag` varchar(255) NOT NULL,
@@ -235,7 +235,7 @@ WHERE (o.cpu is null AND o.speed IS NULL AND o.ram_size IS NULL) AND
-- CLOUDSTACK-9827: Storage tags stored in multiple places
DROP VIEW IF EXISTS `cloud`.`storage_tag_view`;
-CREATE TABLE `cloud`.`guest_os_details` (
+CREATE TABLE IF NOT EXISTS `cloud`.`guest_os_details` (
`id` bigint unsigned NOT NULL auto_increment,
`guest_os_id` bigint unsigned NOT NULL COMMENT 'VPC gateway id',
`name` varchar(255) NOT NULL,
@@ -246,7 +246,7 @@ CREATE TABLE `cloud`.`guest_os_details` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `user_ip_address` ADD COLUMN `rule_state` VARCHAR(32) COMMENT 'static rule state while removing';
-CREATE TABLE `cloud`.`firewall_rules_dcidrs`(
+CREATE TABLE IF NOT EXISTS `cloud`.`firewall_rules_dcidrs`(
`id` BIGINT(20) unsigned NOT NULL AUTO_INCREMENT,
`firewall_rule_id` BIGINT(20) unsigned NOT NULL,
`destination_cidr` VARCHAR(18) DEFAULT NULL,
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services