Skip to content

Commit 99b5f72

Browse files
author
kishan
committed
added queries to handle unit MB to bytes change for volume usage
1 parent f0c43ee commit 99b5f72

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

setup/db/22beta4to22GA.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ ALTER TABLE `cloud_usage`.`usage_ip_address` ADD COLUMN `is_source_nat` smallint
9292
update `cloud`.`usage_event` SET size = 0 where type = 'NET.IPASSIGN' and size is null;
9393
update `cloud_usage`.`usage_event` SET size = 0 where type = 'NET.IPASSIGN' and size is null;
9494

95+
----------------------volume units changed from MB to bytes. Update the same in existing usage_volume records and volume usage events which are not processed-------------
96+
97+
update `cloud_usage`.`usage_volume` set size = (size * 1048576);
98+
update `cloud_usage`.`usage_event` set size = (size * 1048576) where type = 'VOLUME.CREATE' and processed = 0;
99+
95100
ALTER TABLE `cloud_usage`.`cloud_usage` ADD COLUMN `type` varchar(32);
96101

97102
CREATE TABLE `cloud_usage`.`usage_port_forwarding` (

0 commit comments

Comments
 (0)