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 2019/03/13 11:51:22 UTC

[GitHub] [cloudstack] rhtyd commented on issue #3226: server: add support for sorting zones in UI/api

rhtyd commented on issue #3226: server: add support for sorting zones in UI/api
URL: https://github.com/apache/cloudstack/pull/3226#issuecomment-472390925
 
 
   @borisstoyanov @PaulAngus hold testing until master is available again. This introduces an upgrade path that is missing between 4.12 and 4.13. The sql changes are:
   ```
   DROP PROCEDURE IF EXISTS `cloud`.`IDEMPOTENT_ADD_COLUMN`;
   
   CREATE PROCEDURE `cloud`.`IDEMPOTENT_ADD_COLUMN` (
   		IN in_table_name VARCHAR(200)
       , IN in_column_name VARCHAR(200)
       , IN in_column_definition VARCHAR(1000)
   )
   BEGIN
   
       DECLARE CONTINUE HANDLER FOR 1060 BEGIN END; SET @ddl = CONCAT('ALTER TABLE ', in_table_name); SET @ddl = CONCAT(@ddl, ' ', 'ADD COLUMN') ; SET @ddl = CONCAT(@ddl, ' ', in_column_name); SET @ddl = CONCAT(@ddl, ' ', in_column_definition); PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt; END;
   
   -- Add sort_key to data_center
   CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.data_center', 'sort_key', 'INT(32) NOT NULL DEFAULT 0');
   DROP VIEW IF EXISTS `cloud`.`data_center_view`;
   CREATE VIEW `cloud`.`data_center_view` AS
       select
           data_center.id,
           data_center.uuid,
           data_center.name,
           data_center.is_security_group_enabled,
           data_center.is_local_storage_enabled,
           data_center.description,
           data_center.dns1,
           data_center.dns2,
           data_center.ip6_dns1,
           data_center.ip6_dns2,
           data_center.internal_dns1,
           data_center.internal_dns2,
           data_center.guest_network_cidr,
           data_center.domain,
           data_center.networktype,
           data_center.allocation_state,
           data_center.zone_token,
           data_center.dhcp_provider,
           data_center.removed,
           data_center.sort_key,
           domain.id domain_id,
           domain.uuid domain_uuid,
           domain.name domain_name,
           domain.path domain_path,
           dedicated_resources.affinity_group_id,
           dedicated_resources.account_id,
           affinity_group.uuid affinity_group_uuid
       from
           `cloud`.`data_center`
               left join
           `cloud`.`domain` ON data_center.domain_id = domain.id
               left join
           `cloud`.`dedicated_resources` ON data_center.id = dedicated_resources.data_center_id
               left join
           `cloud`.`affinity_group` ON dedicated_resources.affinity_group_id = affinity_group.id; 
   ```

----------------------------------------------------------------
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


With regards,
Apache Git Services