cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ro...@apache.org
Subject [cloudstack] branch 4.11 updated: CLOUDSTACK-10285: Fix db upgrade failure for 4.10.0.0 users (#2452)
Date Wed, 14 Feb 2018 10:54:24 GMT
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch 4.11
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.11 by this push:
     new 3109c59  CLOUDSTACK-10285: Fix db upgrade failure for 4.10.0.0 users (#2452)
3109c59 is described below

commit 3109c590e3d69de83a114ed6fdb12b706e46a7f3
Author: Rohit Yadav <rohit@apache.org>
AuthorDate: Wed Feb 14 11:54:19 2018 +0100

    CLOUDSTACK-10285: Fix db upgrade failure for 4.10.0.0 users (#2452)
    
    4.10.0.0 users when upgrade to 4.11.0.0 may face db related
    discrepancies due to some PRs that got merged without moving their sql
    changes to 4.10->4.11 upgrade path. The 4.10.0.0 users can run those
    missing sql statements manually and then upgrade to 4.11.0.0, since a
    workaround like this is possible this ticket is not marked a blocker. In
    4.11.1.0+, we'll move those changes from 4.9.3.0->4.10.0.0 upgrade path
    to 4.10.0.0->4.11.0.0 upgrade path. Ideally we should not be doing this,
    but this will fix issues for a future 4.10.0.0 user who may want to
    upgrade to 4.11.1.0 or 4.12.0.0+.
    
    Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
---
 .../META-INF/db/schema-41000to41100-cleanup.sql    | 47 +++++++++++++++++++++-
 .../resources/META-INF/db/schema-41000to41100.sql  | 21 ++++++++++
 .../META-INF/db/schema-4930to41000-cleanup.sql     | 45 ---------------------
 .../resources/META-INF/db/schema-4930to41000.sql   | 23 -----------
 4 files changed, 67 insertions(+), 69 deletions(-)

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 1307173..d7a080e 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 50d465c..2e7f9e9 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 c179189..986dcdf 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 db4e860..dbea77d 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';

-- 
To stop receiving notification emails like this one, please contact
rohit@apache.org.

Mime
View raw message