Skip to content

Commit 65b551c

Browse files
authored
feat: Adding admin ability to search by github_id (#1960)
* See nftstorage/admin.storage#68
1 parent ad5773c commit 65b551c

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

File renamed without changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
DROP VIEW admin_search;
2+
3+
CREATE VIEW admin_search as
4+
select
5+
u.id::text as user_id,
6+
u.email as email,
7+
u.github_id as github_id,
8+
ak.secret as token,
9+
ak.id::text as token_id,
10+
ak.deleted_at as deleted_at,
11+
akh.inserted_at as reason_inserted_at,
12+
akh.reason as reason,
13+
akh.status as status
14+
from public.user u
15+
full outer join auth_key ak on ak.user_id = u.id
16+
full outer join (select * from auth_key_history where deleted_at is null) as akh on akh.auth_key_id = ak.id;

packages/api/db/tables.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ CREATE VIEW admin_search as
223223
select
224224
u.id::text as user_id,
225225
u.email as email,
226+
u.github_id as github_id,
226227
ak.secret as token,
227228
ak.id::text as token_id,
228229
ak.deleted_at as deleted_at,

0 commit comments

Comments
 (0)