DaanHoogland commented on code in PR #6589:
URL: https://github.com/apache/cloudstack/pull/6589#discussion_r1713585952


##########
engine/schema/src/main/resources/META-INF/db/schema-41900to42000.sql:
##########
@@ -0,0 +1,98 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+--   http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied.  See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+--;
+-- Schema upgrade from 4.19.0.0 to 4.20.0.0
+--;
+
+-- Add tag column to tables
+CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.resource_limit', 'tag', 
'varchar(64) DEFAULT NULL COMMENT "tag for the limit" ');
+CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.resource_count', 'tag', 
'varchar(64) DEFAULT NULL COMMENT "tag for the resource count" ');
+CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.resource_reservation', 'tag', 
'varchar(64) DEFAULT NULL COMMENT "tag for the resource reservation" ');
+ALTER TABLE `resource_count`
+DROP INDEX `i_resource_count__type_accountId`,
+DROP INDEX `i_resource_count__type_domaintId`,
+ADD UNIQUE INDEX `i_resource_count__type_tag_accountId` 
(`type`,`tag`,`account_id`),
+ADD UNIQUE INDEX `i_resource_count__type_tag_domaintId` 
(`type`,`tag`,`domain_id`);
+
+
+ALTER TABLE `cloud`.`resource_reservation`
+    ADD COLUMN `resource_id` bigint unsigned NULL;
+
+ALTER TABLE `cloud`.`resource_reservation`
+    MODIFY COLUMN `amount` bigint NOT NULL;
+

Review Comment:
   and these?



##########
engine/schema/src/main/resources/META-INF/db/schema-41900to42000.sql:
##########
@@ -0,0 +1,98 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+--   http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied.  See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+--;
+-- Schema upgrade from 4.19.0.0 to 4.20.0.0
+--;
+
+-- Add tag column to tables
+CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.resource_limit', 'tag', 
'varchar(64) DEFAULT NULL COMMENT "tag for the limit" ');
+CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.resource_count', 'tag', 
'varchar(64) DEFAULT NULL COMMENT "tag for the resource count" ');
+CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.resource_reservation', 'tag', 
'varchar(64) DEFAULT NULL COMMENT "tag for the resource reservation" ');
+ALTER TABLE `resource_count`
+DROP INDEX `i_resource_count__type_accountId`,
+DROP INDEX `i_resource_count__type_domaintId`,
+ADD UNIQUE INDEX `i_resource_count__type_tag_accountId` 
(`type`,`tag`,`account_id`),
+ADD UNIQUE INDEX `i_resource_count__type_tag_domaintId` 
(`type`,`tag`,`domain_id`);

Review Comment:
   should these be made idem-potent somehow?



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

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to