-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmysql.db.sql
30 lines (28 loc) · 970 Bytes
/
mysql.db.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
CREATE TABLE `url` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(32) NOT NULL,
`hash` varchar(32) NOT NULL,
`url` text NOT NULL,
`ip` varchar(64) NOT NULL,
`user_agent` text,
`visit_count` int(11) NOT NULL DEFAULT 0,
`create_date` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `idx_code` (`code`),
KEY `idx_hash` (`hash`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4;
CREATE TABLE `visit_history` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`url_id` int(11) NOT NULL,
`ip` varchar(64) NOT NULL,
`user_agent` text,
`create_date` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `idx_url_id` (`url_id`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4;
CREATE TABLE `blacklist` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`domain` varchar(255) NOT NULL,
`create_date` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4;