-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblog.sql
100 lines (100 loc) · 1.81 KB
/
blog.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
CREATE TABLE tag
(
article_id INT,
tag_name TEXT,
PRIMARY KEY (article_id, tag_name)
);
CREATE TABLE article
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
flag TINYINT,
title TEXT,
author TEXT,
create_time DATETIME,
update_time DATETIME,
source_link TEXT,
abstract TEXT,
classification TEXT,
body TEXT,
body_format TEXT,
abstract_format TEXT,
user_id INT
);
CREATE TABLE user
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
app_id TEXT,
open_id TEXT,
union_id TEXT,
nick_name TEXT,
avatar_url TEXT,
gender TINYINT,
admin TINYINT,
create_time DATETIME,
update_time DATETIME
);
CREATE TABLE comment
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
flag TINYINT,
target TEXT,
target_id INT,
user_id INT,
create_time DATETIME,
body TEXT,
update_time DATETIME
);
CREATE TABLE like
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
flag TINYINT,
target TEXT,
target_id INT,
user_id INT,
create_time DATETIME,
update_time DATETIME
);
CREATE TABLE session
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
session_id VARCHAR(255),
data BLOB,
expiry DATETIME
);
CREATE UNIQUE INDEX session_session_id_uindex ON session (session_id);
CREATE TABLE books
(
link TEXT,
title TEXT,
pub TEXT,
img TEXT,
state TEXT,
rating TINYINT,
comment TEXT,
date DATE,
create_time DATETIME,
flag TINYINT,
PRIMARY KEY (link, flag)
);
CREATE TABLE movies
(
link TEXT,
title TEXT,
alias TEXT,
intro TEXT,
img TEXT,
state TEXT,
rating TINYINT,
comment TEXT,
date DATE,
create_time DATETIME,
flag TINYINT,
PRIMARY KEY (link, flag)
);
CREATE TABLE analytics
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
event TEXT,
data TEXT,
create_time DATETIME
);