forked from molikai-work/short
-
Notifications
You must be signed in to change notification settings - Fork 0
/
short.sql
35 lines (34 loc) · 873 Bytes
/
short.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
DROP TABLE IF EXISTS links;
CREATE TABLE IF NOT EXISTS links (
`id` integer PRIMARY KEY NOT NULL,
`url` text,
`slug` text,
`password` text,
`email` text,
`ua` text,
`ip` text,
`status` text,
`hostname` text ,
`create_time` DATE
);
DROP TABLE IF EXISTS logs;
CREATE TABLE IF NOT EXISTS logs (
`id` integer PRIMARY KEY NOT NULL,
`url` text ,
`slug` text,
`referer` text,
`ua` text ,
`ip` text ,
`status` text,
`hostname` text ,
`create_time` DATE
);
DROP TABLE IF EXISTS banDomain;
CREATE TABLE IF NOT EXISTS banDomain (
`id` INTEGER PRIMARY KEY NOT NULL,
`domain` TEXT,
`create_time` TEXT DEFAULT (strftime('%Y-%m-%dT%H:%M:%SZ', 'now'))
);
CREATE UNIQUE INDEX links_index ON links(slug);
CREATE INDEX logs_index ON logs(slug);
CREATE UNIQUE INDEX banDomain_index ON banDomain(domain);