You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2020/10/28 08:54:12 UTC

[cloudstack] branch master updated: Modify alter view to drop/create view (#4417)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 25dd7aa  Modify alter view to drop/create view (#4417)
25dd7aa is described below

commit 25dd7aad517cfb704d7f0719ed80ab1e16cd0ec2
Author: Pearl Dsilva <pe...@gmail.com>
AuthorDate: Wed Oct 28 14:23:56 2020 +0530

    Modify alter view to drop/create view (#4417)
    
    Co-authored-by: Pearl Dsilva <pe...@shapeblue.com>
---
 .../src/main/resources/META-INF/db/schema-41400to41500.sql  | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/engine/schema/src/main/resources/META-INF/db/schema-41400to41500.sql b/engine/schema/src/main/resources/META-INF/db/schema-41400to41500.sql
index bd4d1ca..ae6d1af 100644
--- a/engine/schema/src/main/resources/META-INF/db/schema-41400to41500.sql
+++ b/engine/schema/src/main/resources/META-INF/db/schema-41400to41500.sql
@@ -75,7 +75,8 @@ ALTER TABLE `cloud`.`project_invitations`
     ADD CONSTRAINT `uc_project_invitations__project_id_account_id_user_id` UNIQUE (`project_id`, `account_id`,`user_id`);
 
 -- Alter project_invitation_view to incorporate user_id as a field
-ALTER VIEW `cloud`.`project_invitation_view` AS
+DROP VIEW IF EXISTS `cloud`.`project_invitation_view`;
+CREATE VIEW `cloud`.`project_invitation_view` AS
     select
         project_invitations.id,
         project_invitations.uuid,
@@ -107,7 +108,8 @@ ALTER VIEW `cloud`.`project_invitation_view` AS
         `cloud`.`user` ON project_invitations.user_id = user.id;
 
 -- Alter project_account_view to incorporate user id
-ALTER VIEW `cloud`.`project_account_view` AS
+DROP VIEW IF EXISTS `cloud`.`project_account_view`;
+CREATE VIEW `cloud`.`project_account_view` AS
     select
         project_account.id,
         account.id account_id,
@@ -140,7 +142,9 @@ ALTER VIEW `cloud`.`project_account_view` AS
             left join
         `cloud`.`user` ON (project_account.user_id = user.id);
 
-ALTER VIEW `cloud`.`project_view` AS
+-- Alter project_view to incorporate user id
+DROP VIEW IF EXISTS `cloud`.`project_view`;
+CREATE VIEW `cloud`.`project_view` AS
     select
         projects.id,
         projects.uuid,
@@ -558,7 +562,8 @@ CREATE TABLE `cloud`.`user_vm_deploy_as_is_details` (
 
 ALTER TABLE `cloud`.`image_store` ADD COLUMN `readonly` boolean DEFAULT false COMMENT 'defines status of image store';
 
-ALTER VIEW `cloud`.`image_store_view` AS
+DROP VIEW IF EXISTS `cloud`.`image_store_view`;
+CREATE VIEW `cloud`.`image_store_view` AS
     select
         image_store.id,
         image_store.uuid,