-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.sql
More file actions
38 lines (36 loc) · 1.59 KB
/
Copy pathschema.sql
File metadata and controls
38 lines (36 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
create table oauth2_clients (
id string,
secret string,
redirect_uri string not null default '',
redirect_uris string[] not null default array[]::string[],
token_endpoint_auth_method string not null default 'client_secret_post',
client_name string not null default '',
created_at timestamptz not null default now(),
primary key (id)
);
create table oauth2_codes (
id string,
client_id string not null,
email string not null,
code_challenge string not null default '',
code_challenge_method string not null default '',
redirect_uri string not null default '',
resource string not null default '',
created_at timestamptz not null default now(),
primary key (id),
foreign key (client_id) references oauth2_clients (id) on delete cascade
);
create index oauth2_codes_created_at_idx on oauth2_codes (created_at);
create table oauth2_sessions (
id string,
client_id string not null,
state string not null,
callback_state string not null,
callback_url string not null,
code_challenge string not null default '',
code_challenge_method string not null default '',
resource string not null default '',
created_at timestamptz not null default now(),
primary key (id)
);
create index oauth2_sessions_created_at_idx on oauth2_sessions (created_at);