Skip to content

Commit fffd627

Browse files
committed
Move view to a specific view file
1 parent ae89c44 commit fffd627

File tree

2 files changed

+38
-19
lines changed

2 files changed

+38
-19
lines changed

engine/schema/src/main/resources/META-INF/db/schema-41900to42000.sql

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -103,22 +103,3 @@ CREATE TABLE IF NOT EXISTS `cloud`.`gui_themes_details` (
103103
PRIMARY KEY (`id`),
104104
CONSTRAINT `fk_gui_themes_details__gui_theme_id` FOREIGN KEY (`gui_theme_id`) REFERENCES `gui_themes`(`id`)
105105
);
106-
107-
CREATE OR REPLACE
108-
VIEW `cloud`.`gui_themes_view` AS
109-
SELECT
110-
`cloud`.`gui_themes`.`id` AS `id`,
111-
`cloud`.`gui_themes`.`uuid` AS `uuid`,
112-
`cloud`.`gui_themes`.`name` AS `name`,
113-
`cloud`.`gui_themes`.`description` AS `description`,
114-
`cloud`.`gui_themes`.`css` AS `css`,
115-
`cloud`.`gui_themes`.`json_configuration` AS `json_configuration`,
116-
(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,
117-
(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,
118-
(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,
119-
`cloud`.`gui_themes`.`recursive_domains` AS `recursive_domains`,
120-
`cloud`.`gui_themes`.`is_public` AS `is_public`,
121-
`cloud`.`gui_themes`.`created` AS `created`,
122-
`cloud`.`gui_themes`.`removed` AS `removed`
123-
FROM `cloud`.`gui_themes` LEFT JOIN `cloud`.`gui_themes_details` ON `cloud`.`gui_themes_details`.`gui_theme_id` = `cloud`.`gui_themes`.`id`
124-
GROUP BY `cloud`.`gui_themes`.`id`;
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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

Comments
 (0)