rhtyd closed pull request #2452: CLOUDSTACK-10285: Fix db upgrade failure for 
4.10.0.0 users
URL: https://github.com/apache/cloudstack/pull/2452
 
 
   

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-cleanup.sql 
b/engine/schema/resources/META-INF/db/schema-41000to41100-cleanup.sql
index 1307173148a..d7a080efd16 100644
--- a/engine/schema/resources/META-INF/db/schema-41000to41100-cleanup.sql
+++ b/engine/schema/resources/META-INF/db/schema-41000to41100-cleanup.sql
@@ -21,4 +21,49 @@
 
 DELETE FROM `cloud`.`configuration` WHERE name='snapshot.backup.rightafter';
 -- CLOUDSTACK-9914: Alter quota_tariff to support currency values up to 5 
decimal places
-ALTER TABLE `cloud_usage`.`quota_tariff` MODIFY `currency_value` DECIMAL(15,5) 
not null
+ALTER TABLE `cloud_usage`.`quota_tariff` MODIFY `currency_value` DECIMAL(15,5) 
not null;
+
+DROP VIEW IF EXISTS `cloud`.`user_view`;
+CREATE VIEW `cloud`.`user_view` AS
+    select
+        user.id,
+        user.uuid,
+        user.username,
+        user.password,
+        user.firstname,
+        user.lastname,
+        user.email,
+        user.state,
+        user.api_key,
+        user.secret_key,
+        user.created,
+        user.removed,
+        user.timezone,
+        user.registration_token,
+        user.is_registered,
+        user.incorrect_login_attempts,
+        user.source,
+        user.default,
+        account.id account_id,
+        account.uuid account_uuid,
+        account.account_name account_name,
+        account.type account_type,
+        account.role_id account_role_id,
+        domain.id domain_id,
+        domain.uuid domain_uuid,
+        domain.name domain_name,
+        domain.path domain_path,
+        async_job.id job_id,
+        async_job.uuid job_uuid,
+        async_job.job_status job_status,
+        async_job.account_id job_account_id
+    from
+        `cloud`.`user`
+            inner join
+        `cloud`.`account` ON user.account_id = account.id
+            inner join
+        `cloud`.`domain` ON account.domain_id = domain.id
+            left join
+        `cloud`.`async_job` ON async_job.instance_id = user.id
+            and async_job.instance_type = 'User'
+            and async_job.job_status = 0;
diff --git a/engine/schema/resources/META-INF/db/schema-41000to41100.sql 
b/engine/schema/resources/META-INF/db/schema-41000to41100.sql
index 50d465c4933..2e7f9e9fe9c 100644
--- a/engine/schema/resources/META-INF/db/schema-41000to41100.sql
+++ b/engine/schema/resources/META-INF/db/schema-41000to41100.sql
@@ -546,3 +546,24 @@ ALTER TABLE cloud.ldap_trust_map ADD COLUMN account_id 
BIGINT(20) DEFAULT 0;
 ALTER TABLE cloud.ldap_trust_map DROP FOREIGN KEY fk_ldap_trust_map__domain_id;
 DROP INDEX uk_ldap_trust_map__domain_id ON cloud.ldap_trust_map;
 CREATE UNIQUE INDEX uk_ldap_trust_map__bind_location ON ldap_trust_map 
(domain_id, account_id);
+
+CREATE TABLE IF NOT EXISTS `cloud`.`netscaler_servicepackages` (
+  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+  `uuid` varchar(255) UNIQUE,
+  `name` varchar(255) UNIQUE COMMENT 'name of the service package',
+  `description` varchar(255) COMMENT 'description of the service package',
+  PRIMARY KEY  (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `cloud`.`external_netscaler_controlcenter` (
+  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+  `uuid` varchar(255) UNIQUE,
+  `username` varchar(255) COMMENT 'username of the NCC',
+  `password` varchar(255) COMMENT 'password of NCC',
+  `ncc_ip` varchar(255) COMMENT 'IP of NCC Manager',
+  `num_retries` bigint unsigned NOT NULL default 2 COMMENT 'Number of retries 
in ncc for command failure',
+  PRIMARY KEY  (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+ALTER TABLE `cloud`.`sslcerts` ADD COLUMN `name` varchar(255) NULL default 
NULL COMMENT 'Name of the Certificate';
+ALTER TABLE `cloud`.`network_offerings` ADD COLUMN `service_package_id` 
varchar(255) NULL default NULL COMMENT 'Netscaler ControlCenter Service 
Package';
diff --git a/engine/schema/resources/META-INF/db/schema-4930to41000-cleanup.sql 
b/engine/schema/resources/META-INF/db/schema-4930to41000-cleanup.sql
index c1791890e3a..986dcdfe7da 100644
--- a/engine/schema/resources/META-INF/db/schema-4930to41000-cleanup.sql
+++ b/engine/schema/resources/META-INF/db/schema-4930to41000-cleanup.sql
@@ -22,48 +22,3 @@
 DELETE FROM `cloud`.`configuration` WHERE 
name='consoleproxy.loadscan.interval';
 
 DELETE FROM `cloud`.`host_details` where name = 'vmName' and  value in (select 
name from `cloud`.`vm_instance`  where state = 'Expunging' and hypervisor_type 
='BareMetal');
-
-DROP VIEW IF EXISTS `cloud`.`user_view`;
-CREATE VIEW `cloud`.`user_view` AS
-    select
-        user.id,
-        user.uuid,
-        user.username,
-        user.password,
-        user.firstname,
-        user.lastname,
-        user.email,
-        user.state,
-        user.api_key,
-        user.secret_key,
-        user.created,
-        user.removed,
-        user.timezone,
-        user.registration_token,
-        user.is_registered,
-        user.incorrect_login_attempts,
-        user.source,
-        user.default,
-        account.id account_id,
-        account.uuid account_uuid,
-        account.account_name account_name,
-        account.type account_type,
-        account.role_id account_role_id,
-        domain.id domain_id,
-        domain.uuid domain_uuid,
-        domain.name domain_name,
-        domain.path domain_path,
-        async_job.id job_id,
-        async_job.uuid job_uuid,
-        async_job.job_status job_status,
-        async_job.account_id job_account_id
-    from
-        `cloud`.`user`
-            inner join
-        `cloud`.`account` ON user.account_id = account.id
-            inner join
-        `cloud`.`domain` ON account.domain_id = domain.id
-            left join
-        `cloud`.`async_job` ON async_job.instance_id = user.id
-            and async_job.instance_type = 'User'
-            and async_job.job_status = 0;
diff --git a/engine/schema/resources/META-INF/db/schema-4930to41000.sql 
b/engine/schema/resources/META-INF/db/schema-4930to41000.sql
index db4e8605580..dbea77d5e33 100644
--- a/engine/schema/resources/META-INF/db/schema-4930to41000.sql
+++ b/engine/schema/resources/META-INF/db/schema-4930to41000.sql
@@ -255,26 +255,3 @@ CREATE TABLE `cloud`.`firewall_rules_dcidrs`(
   KEY `fk_firewall_dcidrs_firewall_rules` (`firewall_rule_id`),
   CONSTRAINT `fk_firewall_dcidrs_firewall_rules` FOREIGN KEY 
(`firewall_rule_id`) REFERENCES `firewall_rules` (`id`) ON DELETE CASCADE
 )ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-DROP TABLE IF EXISTS `cloud`.`netscaler_servicepackages`;
-CREATE TABLE `cloud`.`netscaler_servicepackages` (
-  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
-  `uuid` varchar(255) UNIQUE,
-  `name` varchar(255) UNIQUE COMMENT 'name of the service package',
-  `description` varchar(255) COMMENT 'description of the service package',
-  PRIMARY KEY  (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-DROP TABLE IF EXISTS `cloud`.`external_netscaler_controlcenter`;
-CREATE TABLE `cloud`.`external_netscaler_controlcenter` (
-  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
-  `uuid` varchar(255) UNIQUE,
-  `username` varchar(255) COMMENT 'username of the NCC',
-  `password` varchar(255) COMMENT 'password of NCC',
-  `ncc_ip` varchar(255) COMMENT 'IP of NCC Manager',
-  `num_retries` bigint unsigned NOT NULL default 2 COMMENT 'Number of retries 
in ncc for command failure',
-  PRIMARY KEY  (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-ALTER TABLE `cloud`.`sslcerts` ADD COLUMN `name` varchar(255) NULL default 
NULL COMMENT 'Name of the Certificate';
-ALTER TABLE `cloud`.`network_offerings` ADD COLUMN `service_package_id` 
varchar(255) NULL default NULL COMMENT 'Netscaler ControlCenter Service 
Package';


 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to