Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 156f382

Browse files
committed
bump migration
1 parent 45350bc commit 156f382

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

coderd/database/migrations/000325_version_dynamic_parameter_flow.down.sql

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
ALTER TABLE templates DROP COLUMN classic_parameter_flow;
2+
3+
-- Update the template_with_names view by recreating it.
4+
DROP VIEW template_with_names;
5+
CREATE VIEW
6+
template_with_names
7+
AS
8+
SELECT
9+
templates.*,
10+
coalesce(visible_users.avatar_url, '') AS created_by_avatar_url,
11+
coalesce(visible_users.username, '') AS created_by_username,
12+
coalesce(organizations.name, '') AS organization_name,
13+
coalesce(organizations.display_name, '') AS organization_display_name,
14+
coalesce(organizations.icon, '') AS organization_icon
15+
FROM
16+
templates
17+
LEFT JOIN
18+
visible_users
19+
ON
20+
templates.created_by = visible_users.id
21+
LEFT JOIN
22+
organizations
23+
ON templates.organization_id = organizations.id
24+
;
25+
26+
COMMENT ON VIEW template_with_names IS 'Joins in the display name information such as username, avatar, and organization name.';

0 commit comments

Comments
 (0)