This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
     new 2d669dbe548 engine-schema: fix duplicate statements in upgrade path 
(#11001)
2d669dbe548 is described below

commit 2d669dbe5488a68fff1b05553dcf2ba8020d20b1
Author: Abhishek Kumar <abhishek.mr...@gmail.com>
AuthorDate: Thu Jun 12 11:34:43 2025 +0530

    engine-schema: fix duplicate statements in upgrade path (#11001)
    
    Some statements to add new columns to cloud.guest_os_category have been
    added twice by mistake as part of #10773. These statements are idempotent 
and won't affect
    upgrade as such but better to cleanup
    
    Signed-off-by: Abhishek Kumar <abhishek.mr...@gmail.com>
---
 .../schema/src/main/resources/META-INF/db/schema-42010to42100.sql | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git 
a/engine/schema/src/main/resources/META-INF/db/schema-42010to42100.sql 
b/engine/schema/src/main/resources/META-INF/db/schema-42010to42100.sql
index 654dd0fad29..4ab091292f5 100644
--- a/engine/schema/src/main/resources/META-INF/db/schema-42010to42100.sql
+++ b/engine/schema/src/main/resources/META-INF/db/schema-42010to42100.sql
@@ -81,12 +81,11 @@ CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.cluster', 
'storage_access_groups', '
 CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.host_pod_ref', 
'storage_access_groups', 'varchar(255) DEFAULT NULL COMMENT "storage access 
groups for the hosts in the pod"');
 CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.data_center', 
'storage_access_groups', 'varchar(255) DEFAULT NULL COMMENT "storage access 
groups for the hosts in the zone"');
 
--- Add featured column for guest_os_category
+-- Add featured, sort_key, created, removed columns for guest_os_category
 CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.guest_os_category', 'featured', 
'tinyint(1) NOT NULL DEFAULT 0 COMMENT "whether the category is featured or 
not" AFTER `uuid`');
 CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.guest_os_category', 'sort_key', 
'int NOT NULL DEFAULT 0 COMMENT "sort key used for customising sort method" 
AFTER `featured`');
 CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.guest_os_category', 'created', 
'datetime COMMENT "date on which the category was created" AFTER `sort_key`');
 CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.guest_os_category', 'removed', 
'datetime COMMENT "date removed if not null" AFTER `created`');
-UPDATE `cloud`.`guest_os_category` SET `featured` = 1 WHERE `name` NOT IN 
('Novel', 'None');
 
 -- Begin: Changes for Guest OS category cleanup
 -- Add new OS categories if not present
@@ -147,11 +146,8 @@ CALL 
`cloud`.`UPDATE_NEW_AND_DELETE_OLD_CATEGORY_FOR_GUEST_OS`('Other', 'None');
 CALL `cloud`.`UPDATE_NEW_AND_DELETE_OLD_CATEGORY_FOR_GUEST_OS`('Other', 
'Unix');
 CALL `cloud`.`UPDATE_NEW_AND_DELETE_OLD_CATEGORY_FOR_GUEST_OS`('Other', 'Mac');
 
--- Add featured column for cloud.guest_os_category
-CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.guest_os_category', 'featured', 
'tinyint(1) NOT NULL DEFAULT 0 COMMENT "whether the category is featured or 
not" AFTER `uuid`');
+-- Update featured for existing guest OS categories
 UPDATE `cloud`.`guest_os_category` SET featured = 1;
--- Add sort_key column for cloud.guest_os_category
-CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.guest_os_category', 'sort_key', 
'int NOT NULL DEFAULT 0 COMMENT "sort key used for customising sort method" 
AFTER `featured`');
 
 -- Update sort order for all guest OS categories
 UPDATE `cloud`.`guest_os_category`

Reply via email to