GutoVeronezi commented on code in PR #6442:
URL: https://github.com/apache/cloudstack/pull/6442#discussion_r1097877171


##########
engine/schema/src/main/resources/META-INF/db/schema-41720to41800.sql:
##########
@@ -1492,3 +1492,120 @@ CREATE TABLE IF NOT EXISTS `cloud`.`console_session` (
 INSERT INTO `cloud`.`role_permissions` (`uuid`, `role_id`, `rule`, 
`permission`) VALUES (UUID(), 2, 'assignVolume', 'ALLOW');
 INSERT INTO `cloud`.`role_permissions` (`uuid`, `role_id`, `rule`, 
`permission`) VALUES (UUID(), 3, 'assignVolume', 'ALLOW');
 
+-- select initial ip for VPCs --
+ALTER TABLE cloud.network_offerings ADD specify_source_nat_address_allowed 
tinyint(1) DEFAULT 0 NOT NULL COMMENT 'true if it is allowed to specify the 
primary public ip for this network on creation';
+ALTER TABLE cloud.vpc_offerings ADD specify_source_nat_address_allowed 
tinyint(1) DEFAULT 0 NOT NULL COMMENT 'true if it is allowed to specify the 
primary public ip for this vpc on creation';
+
+-- cloud.network_offering_view source
+
+DROP VIEW IF EXISTS `cloud`.`network_offering_view`;
+CREATE VIEW `cloud`.`network_offering_view` AS
+    SELECT
+        `network_offerings`.`id` AS `id`,
+        `network_offerings`.`uuid` AS `uuid`,
+        `network_offerings`.`name` AS `name`,
+        `network_offerings`.`unique_name` AS `unique_name`,
+        `network_offerings`.`display_text` AS `display_text`,
+        `network_offerings`.`nw_rate` AS `nw_rate`,
+        `network_offerings`.`mc_rate` AS `mc_rate`,
+        `network_offerings`.`traffic_type` AS `traffic_type`,
+        `network_offerings`.`tags` AS `tags`,
+        `network_offerings`.`system_only` AS `system_only`,
+        `network_offerings`.`specify_vlan` AS `specify_vlan`,
+        `network_offerings`.`service_offering_id` AS `service_offering_id`,
+        `network_offerings`.`conserve_mode` AS `conserve_mode`,
+        `network_offerings`.`created` AS `created`,
+        `network_offerings`.`removed` AS `removed`,
+        `network_offerings`.`default` AS `default`,
+        `network_offerings`.`availability` AS `availability`,
+        `network_offerings`.`dedicated_lb_service` AS `dedicated_lb_service`,
+        `network_offerings`.`shared_source_nat_service` AS 
`shared_source_nat_service`,
+        `network_offerings`.`sort_key` AS `sort_key`,
+        `network_offerings`.`redundant_router_service` AS 
`redundant_router_service`,
+        `network_offerings`.`state` AS `state`,
+        `network_offerings`.`guest_type` AS `guest_type`,
+        `network_offerings`.`elastic_ip_service` AS `elastic_ip_service`,
+        `network_offerings`.`eip_associate_public_ip` AS 
`eip_associate_public_ip`,
+        `network_offerings`.`elastic_lb_service` AS `elastic_lb_service`,
+        `network_offerings`.`specify_ip_ranges` AS `specify_ip_ranges`,
+        `network_offerings`.`inline` AS `inline`,
+        `network_offerings`.`is_persistent` AS `is_persistent`,
+        `network_offerings`.`internal_lb` AS `internal_lb`,
+        `network_offerings`.`public_lb` AS `public_lb`,
+        `network_offerings`.`egress_default_policy` AS `egress_default_policy`,
+        `network_offerings`.`concurrent_connections` AS 
`concurrent_connections`,
+        `network_offerings`.`keep_alive_enabled` AS `keep_alive_enabled`,
+        `network_offerings`.`supports_streched_l2` AS `supports_streched_l2`,
+        `network_offerings`.`supports_public_access` AS 
`supports_public_access`,
+        `network_offerings`.`supports_vm_autoscaling` AS 
`supports_vm_autoscaling`,
+        `network_offerings`.`for_vpc` AS `for_vpc`,
+        `network_offerings`.`service_package_id` AS `service_package_id`,
+        `network_offerings`.`specify_source_nat_address_allowed` as 
`specify_source_nat_address_allowed`,
+        GROUP_CONCAT(DISTINCT domain.id) AS domain_id,
+        GROUP_CONCAT(DISTINCT domain.uuid) AS domain_uuid,
+        GROUP_CONCAT(DISTINCT domain.name) AS domain_name,
+        GROUP_CONCAT(DISTINCT domain.path) AS domain_path,
+        GROUP_CONCAT(DISTINCT zone.id) AS zone_id,
+        GROUP_CONCAT(DISTINCT zone.uuid) AS zone_uuid,
+        GROUP_CONCAT(DISTINCT zone.name) AS zone_name,
+        `offering_details`.value AS internet_protocol
+    FROM
+        `cloud`.`network_offerings`
+            LEFT JOIN
+        `cloud`.`network_offering_details` AS `domain_details` ON 
`domain_details`.`network_offering_id` = `network_offerings`.`id` AND 
`domain_details`.`name` = 'domainid'
+            LEFT JOIN
+        `cloud`.`domain` AS `domain` ON FIND_IN_SET(`domain`.`id`, 
`domain_details`.`value`)
+            LEFT JOIN
+        `cloud`.`network_offering_details` AS `zone_details` ON 
`zone_details`.`network_offering_id` = `network_offerings`.`id` AND 
`zone_details`.`name` = 'zoneid'
+            LEFT JOIN
+        `cloud`.`data_center` AS `zone` ON FIND_IN_SET(`zone`.`id`, 
`zone_details`.`value`)
+            LEFT JOIN
+        `cloud`.`network_offering_details` AS `offering_details` ON 
`offering_details`.`network_offering_id` = `network_offerings`.`id` AND 
`offering_details`.`name` = 'internetProtocol'
+    GROUP BY
+        `network_offerings`.`id`;
+
+-- cloud.vpc_offering_view source
+
+CREATE OR REPLACE
+ALGORITHM = UNDEFINED VIEW `vpc_offering_view` AS

Review Comment:
   ```suggestion
   DROP VIEW IF EXISTS `cloud`.`vpc_offering_view`;
   CREATE VIEW `cloud`.`vpc_offering_view` AS
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to