-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.sql
42 lines (33 loc) · 880 Bytes
/
schema.sql
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
39
40
41
42
CREATE TABLE users (
user_id INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT UNIQUE NOT NULL,
display_name TEXT NOT NULL,
email TEXT UNIQUE NOT NULL,
password TEXT NOT NULL
);
CREATE INDEX idx_email ON users(email);
CREATE TABLE admins (
admin_name TEXT PRIMARY KEY,
password TEXT NOT NULL
);
CREATE TABLE apps (
app_id INTEGER PRIMARY KEY AUTOINCREMENT,
app_name TEXT UNIQUE,
app_secret TEXT NOT NULL,
redirect_url TEXT NOT NULL,
-- permissions TEXT NOT NULL,
-- permissions_date TEXT NOT NULL,
attributes TEXT NOT NULL
);
-- CREATE TABLE user_authorizations (
-- userid INTEGER,
-- appid INTEGER,
-- authorization_date TEXT NOT NULL,
-- PRIMARY KEY (userid, appid)
-- );
CREATE TABLE user_data (
user_id INTEGER,
scope_key TEXT,
scope_value TEXT NOT NULL,
PRIMARY KEY (user_id, scope_key)
);