-
Notifications
You must be signed in to change notification settings - Fork 881
chore: include organization name when fetching templates #13751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
df2acd3
1fd02c9
48f2ecf
d7a0abf
eeb0f48
01b973f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
DROP VIEW template_with_names; | ||
|
||
CREATE VIEW | ||
template_with_users | ||
AS | ||
SELECT | ||
templates.*, | ||
coalesce(visible_users.avatar_url, '') AS created_by_avatar_url, | ||
coalesce(visible_users.username, '') AS created_by_username | ||
FROM | ||
templates | ||
LEFT JOIN | ||
visible_users | ||
ON | ||
templates.created_by = visible_users.id; | ||
COMMENT ON VIEW template_with_users IS 'Joins in the username + avatar url of the created by user.'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
-- Update the template_with_users view by recreating it. | ||
DROP VIEW template_with_users; | ||
|
||
-- Renaming template_with_users -> template_with_names | ||
CREATE VIEW | ||
template_with_names | ||
AS | ||
SELECT | ||
templates.*, | ||
coalesce(visible_users.avatar_url, '') AS created_by_avatar_url, | ||
coalesce(visible_users.username, '') AS created_by_username, | ||
coalesce(organizations.name, '') AS organization_name | ||
FROM | ||
templates | ||
LEFT JOIN | ||
visible_users | ||
ON | ||
templates.created_by = visible_users.id | ||
LEFT JOIN | ||
organizations | ||
ON templates.organization_id = organizations.id | ||
; | ||
|
||
COMMENT ON VIEW template_with_names IS 'Joins in the display name information such as username, avatar, and organization name.'; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reminder: double-check migration number before merge!