-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.sql
41 lines (41 loc) · 881 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
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE users (
id integer primary key,
username varchar(64),
public_key varchar(64),
challenge varchar(32),
created text,
verified text,
deleted text,
modified text
);
CREATE TABLE trusts (
id integer primary key,
user_id integer,
user_id2 integer,
value integer,
created text,
deleted text,
modified text
);
CREATE TABLE ratings (
id integer primary key,
user_id integer,
uri varchar(1024),
value integer,
created text,
deleted text,
modified text,
foreign key(user_id) references users(user_id)
);
CREATE TABLE log (
created text,
ip varchar(45), /* max length of ipv6 address */
action varchar(10),
bytes integer,
user_id integer(64),
message text,
foreign key(user_id) references users(user_id)
);
COMMIT;