weizhouapache commented on a change in pull request #5965:
URL: https://github.com/apache/cloudstack/pull/5965#discussion_r812751301



##########
File path: engine/schema/src/main/resources/META-INF/db/schema-41610to41700.sql
##########
@@ -641,3 +641,8 @@ CREATE VIEW `cloud`.`domain_router_view` AS
         `cloud`.`async_job` ON async_job.instance_id = vm_instance.id
             and async_job.instance_type = 'DomainRouter'
             and async_job.job_status = 0;
+
+INSERT INTO `cloud`.`user_vm_details`(`vm_id`, `name`, `value`)

Review comment:
       @davidjumani 
   I think it would be better to consider all possible scenarios.
   
   my sugguestion is
   
   ```
   INSERT INTO `cloud`.`user_vm_details`(`vm_id`, `name`, `value`)
   SELECT `user_vm_details`.`vm_id`, 'SSH.KeyPairNames', 
`ssh_keypairs`.`keypair_name`
           FROM `cloud`.`user_vm_details`
           INNER JOIN `cloud`.`ssh_keypairs` ON ssh_keypairs.public_key = 
user_vm_details.value
           INNER JOIN `cloud`.`vm_instance` ON vm_instance.id = 
user_vm_details.vm_id
           WHERE ssh_keypairs.account_id = vm_instance.account_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.

To unsubscribe, e-mail: [email protected]

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


Reply via email to