Skip to content

Commit 52da1c8

Browse files
committed
chore: add view for joinable user fields
1 parent 67494a3 commit 52da1c8

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

coderd/database/dump.sql

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
BEGIN;
2+
3+
DROP VIEW visible_users;
4+
5+
COMMIT;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
BEGIN;
2+
3+
CREATE VIEW
4+
visible_users
5+
AS
6+
SELECT
7+
id, username, avatar_url
8+
FROM
9+
users;
10+
11+
COMMENT ON VIEW visible_users IS 'Visible fields of users are allowed to be joined with other tables for including context of other resources.';
12+
13+
COMMIT;

coderd/database/models.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)