-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathschema.txt
54 lines (49 loc) · 1.9 KB
/
schema.txt
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
43
44
45
46
47
48
49
50
51
52
53
54
create table config (
version text not null,
name text not null,
description text not null,
secret_key text not null,
captcha_key text not null,
registration_enabled boolean not null
);
create table users (
user_id integer unique not null primary key autoincrement,
name varchar(32) unique not null,
password varchar(128) not null,
about text not null default '',
join_time integer not null,
role integer not null default 0,
banned_until integer not null default 0
);
create table threads (
thread_id integer unique not null primary key autoincrement,
author_id integer not null,
forum_id integer not null,
create_time integer not null,
modify_time integer not null,
update_time integer not null,
title varchar(64) not null,
text text not null,
score integer not null default 0,
hidden boolean not null default false
);
create table comments (
comment_id integer unique not null primary key autoincrement,
thread_id integer not null,
author_id integer not null,
parent_id integer,
create_time integer not null,
modify_time integer not null,
text text not null,
score integer not null default 0,
hidden boolean not null default false
);
create table forums (
forum_id integer unique not null primary key autoincrement,
name varchar(64) not null,
description text not null default ''
);
-- Both of these speed up searches significantly if there are many threads or comments.
-- Other indices have no measureable impact (yet, at least).
create index forum_id on threads(forum_id);
create index thread_id on comments(thread_id);