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 2020/11/23 12:05:34 UTC

[GitHub] [cloudstack] weizhouapache commented on a change in pull request #4494: sql: Fix Zones are returned in a random order (#3934)

weizhouapache commented on a change in pull request #4494:
URL: https://github.com/apache/cloudstack/pull/4494#discussion_r528655634



##########
File path: engine/schema/src/main/resources/META-INF/db/schema-41400to41500.sql
##########
@@ -837,3 +837,6 @@ UPDATE `cloud`.`guest_os` SET category_id = 7 WHERE id = 275 AND display_name =
 -- Add flag 'hidden' in tables usage_ip_address and cloud_usage
 ALTER TABLE `cloud_usage`.`usage_ip_address` ADD COLUMN `is_hidden` smallint(1) NOT NULL DEFAULT '0' COMMENT 'is usage hidden';
 ALTER TABLE `cloud_usage`.`cloud_usage` ADD COLUMN `is_hidden` smallint(1) NOT NULL DEFAULT '0' COMMENT 'is usage hidden';
+
+-- Fix Zones are returned in a random order (#3934)
+UPDATE `cloud`.`data_center` JOIN (SELECT COUNT(1) AS count FROM `cloud`.`data_center` WHERE `sort_key` != 0) AS tbl_tmp SET `sort_key` = `id` WHERE count = 0;

Review comment:
       @DaanHoogland assume the sort_key is 1,0, with your sql sort_key will be changed to 1,2.
   the order of zones is changed by the sql.
   
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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