|
| 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 | +-- VIEW `cloud`.`gui_themes_view`; |
| 19 | + |
| 20 | +DROP VIEW IF EXISTS `cloud`.`gui_themes_view`; |
| 21 | + |
| 22 | +CREATE VIEW `cloud`.`gui_themes_view` AS |
| 23 | +SELECT |
| 24 | + `cloud`.`gui_themes`.`id` AS `id`, |
| 25 | + `cloud`.`gui_themes`.`uuid` AS `uuid`, |
| 26 | + `cloud`.`gui_themes`.`name` AS `name`, |
| 27 | + `cloud`.`gui_themes`.`description` AS `description`, |
| 28 | + `cloud`.`gui_themes`.`css` AS `css`, |
| 29 | + `cloud`.`gui_themes`.`json_configuration` AS `json_configuration`, |
| 30 | + (SELECT group_concat(gtd.`value` separator ',') FROM `cloud`.`gui_themes_details` gtd WHERE gtd.`type` = 'commonName' AND gtd.gui_theme_id = `cloud`.`gui_themes`.`id`) common_names, |
| 31 | + (SELECT group_concat(gtd.`value` separator ',') FROM `cloud`.`gui_themes_details` gtd WHERE gtd.`type` = 'domain' AND gtd.gui_theme_id = `cloud`.`gui_themes`.`id`) domains, |
| 32 | + (SELECT group_concat(gtd.`value` separator ',') FROM `cloud`.`gui_themes_details` gtd WHERE gtd.`type` = 'account' AND gtd.gui_theme_id = `cloud`.`gui_themes`.`id`) accounts, |
| 33 | + `cloud`.`gui_themes`.`recursive_domains` AS `recursive_domains`, |
| 34 | + `cloud`.`gui_themes`.`is_public` AS `is_public`, |
| 35 | + `cloud`.`gui_themes`.`created` AS `created`, |
| 36 | + `cloud`.`gui_themes`.`removed` AS `removed` |
| 37 | +FROM `cloud`.`gui_themes` LEFT JOIN `cloud`.`gui_themes_details` ON `cloud`.`gui_themes_details`.`gui_theme_id` = `cloud`.`gui_themes`.`id` |
| 38 | +GROUP BY `cloud`.`gui_themes`.`id`; |
0 commit comments