forked from wangwangit/nav
-
Notifications
You must be signed in to change notification settings - Fork 304
Expand file tree
/
Copy pathschema.sql
More file actions
49 lines (45 loc) · 1.42 KB
/
schema.sql
File metadata and controls
49 lines (45 loc) · 1.42 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
39
40
41
42
43
44
45
46
47
48
49
-- 网站配置表
CREATE TABLE IF NOT EXISTS sites (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
url TEXT NOT NULL,
logo TEXT,
desc TEXT,
catelog_id INTEGER NOT NULL,
catelog_name TEXT,
sort_order INTEGER NOT NULL DEFAULT 9999,
is_private INTEGER DEFAULT 0,
create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX IF NOT EXISTS idx_sites_catelog_id ON sites(catelog_id);
CREATE INDEX IF NOT EXISTS idx_sites_sort_order ON sites(sort_order);
CREATE INDEX IF NOT EXISTS idx_sites_private_sort ON sites(is_private, sort_order);
CREATE INDEX IF NOT EXISTS idx_sites_catelog_name ON sites(catelog_name);
CREATE INDEX IF NOT EXISTS idx_sites_url ON sites(url);
-- 待审核网站表
CREATE TABLE IF NOT EXISTS pending_sites (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
url TEXT NOT NULL,
logo TEXT,
desc TEXT,
catelog_id INTEGER NOT NULL,
catelog_name TEXT,
create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- 分类表
CREATE TABLE IF NOT EXISTS category (
id INTEGER PRIMARY KEY AUTOINCREMENT,
catelog TEXT NOT NULL,
sort_order INTEGER NOT NULL DEFAULT 9999,
parent_id INTEGER DEFAULT 0,
is_private INTEGER DEFAULT 0,
create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- 设置表
CREATE TABLE IF NOT EXISTS settings (
key TEXT PRIMARY KEY,
value TEXT
);