|
| 1 | +-- Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +-- or more contributor license agreements. See the NOTICE file |
| 3 | +-- distributed with this work for additional information |
| 4 | +-- regarding copyright ownership. The ASF licenses this file |
| 5 | +-- to you under the Apache License, Version 2.0 (the |
| 6 | +-- "License"); you may not use this file except in compliance |
| 7 | +-- with the License. You may obtain a copy of the License at |
| 8 | +-- |
| 9 | +-- http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +-- |
| 11 | +-- Unless required by applicable law or agreed to in writing, |
| 12 | +-- software distributed under the License is distributed on an |
| 13 | +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +-- KIND, either express or implied. See the License for the |
| 15 | +-- specific language governing permissions and limitations |
| 16 | +-- under the License. |
| 17 | + |
| 18 | +-- cloud.event_view source |
| 19 | + |
| 20 | + |
| 21 | +DROP VIEW IF EXISTS `cloud`.`event_view`; |
| 22 | + |
| 23 | +CREATE VIEW `cloud`.`event_view` AS |
| 24 | +select |
| 25 | + `event`.`id` AS `id`, |
| 26 | + `event`.`uuid` AS `uuid`, |
| 27 | + `event`.`type` AS `type`, |
| 28 | + `event`.`state` AS `state`, |
| 29 | + `event`.`description` AS `description`, |
| 30 | + `event`.`resource_id` AS `resource_id`, |
| 31 | + `event`.`resource_type` AS `resource_type`, |
| 32 | + `event`.`created` AS `created`, |
| 33 | + `event`.`level` AS `level`, |
| 34 | + `event`.`parameters` AS `parameters`, |
| 35 | + `event`.`start_id` AS `start_id`, |
| 36 | + `eve`.`uuid` AS `start_uuid`, |
| 37 | + `event`.`user_id` AS `user_id`, |
| 38 | + `event`.`archived` AS `archived`, |
| 39 | + `event`.`display` AS `display`, |
| 40 | + `user`.`username` AS `user_name`, |
| 41 | + `account`.`id` AS `account_id`, |
| 42 | + `account`.`uuid` AS `account_uuid`, |
| 43 | + `account`.`account_name` AS `account_name`, |
| 44 | + `account`.`type` AS `account_type`, |
| 45 | + `domain`.`id` AS `domain_id`, |
| 46 | + `domain`.`uuid` AS `domain_uuid`, |
| 47 | + `domain`.`name` AS `domain_name`, |
| 48 | + `domain`.`path` AS `domain_path`, |
| 49 | + `projects`.`id` AS `project_id`, |
| 50 | + `projects`.`uuid` AS `project_uuid`, |
| 51 | + `projects`.`name` AS `project_name` |
| 52 | +from |
| 53 | + (((((`event` |
| 54 | +join `account` on |
| 55 | + ((`event`.`account_id` = `account`.`id`))) |
| 56 | +join `domain` on |
| 57 | + ((`event`.`domain_id` = `domain`.`id`))) |
| 58 | +join `user` on |
| 59 | + ((`event`.`user_id` = `user`.`id`))) |
| 60 | +left join `projects` on |
| 61 | + ((`projects`.`project_account_id` = `event`.`account_id`))) |
| 62 | +left join `event` `eve` on |
| 63 | + ((`event`.`start_id` = `eve`.`id`))); |
0 commit comments