-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdatabase.sql
74 lines (66 loc) · 2.33 KB
/
database.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
CREATE DATABASE `software` /*!40100 DEFAULT CHARACTER SET utf8 */
CREATE TABLE `users` (
`userID` int NOT NULL AUTO_INCREMENT,
`username` varchar(16) NOT NULL,
`password` varchar(32) NOT NULL,
`score` int NOT NULL DEFAULT 0,
`college` varchar (64) DEFAULT NULL,
`email` varchar(64) DEFAULT NULL,
`registe_time` int DEFAULT 0,
`registe_ip` varchar(16) not null;
`salt` varchar(16) DEFAULT NULL,
`token` varchar(32) DEFAULT NULL,
`token_alive_time` int DEFAULT 0,
`verified` tinyint NOT NULL DEFAULT 0,
`usertype` tinyint NOT NULL DEFAULT 0,
PRIMARY KEY (`userID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
CREATE TABLE `challenges` (
`challengeID` int NOT NULL AUTO_INCREMENT,
`name` varchar(32) NOT NULL,
`description` varchar(512) NOT NULL,
`flag` varchar(64) NOT NULL,
`score` int NOT NULL DEFAULT 0,
`type` ENUM('web', 'pwn', 'stego', 'misc', 'crypto', 'forensics', 'others'),
`online_time` int NOT NULL,
`visit_times` int DEFAULT 0,
`fixing` tinyint DEFAULT 0,
`resource` varchar(512) DEFAULT NULL,
`document` varchar(512) DEFAULT NULL,
``
PRIMARY KEY (`challengeID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
CREATE TABLE `submit_log` (
`submitID` int NOT NULL AUTO_INCREMENT,
`challengeID`int NOT NULL,
`userID`int NOT NULL,
`flag` varchar(64) NOT NULL,
`submit_time` int DEFAULT 0,
`is_current` tinyint NOT NULL DEFAULT 0,
PRIMARY KEY (`submitID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
CREATE TABLE `news` (
`newsID` int NOT NULL AUTO_INCREMENT,
`title` varchar(64) NOT NULL,
`content` varchar(512) NOT NULL,
`authorID` int NOT NULL,
`submit_time` int NOT NULL DEFAULT 0,
`visit_times` int DEFAULT 0,
PRIMARY KEY (`newsID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
CREATE TABLE `login_log` (
`loginID` int NOT NULL AUTO_INCREMENT,
`username` varchar(16) NOT NULL,
`password` varchar(32) NOT NULL,
`login_time` int DEFAULT 0,
`login_ip` varchar(16) not null;
PRIMARY KEY (`loginID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
CREATE TABLE captcha (
captcha_id bigint(13) unsigned NOT NULL auto_increment,
captcha_time int(10) unsigned NOT NULL,
ip_address varchar(45) NOT NULL,
word varchar(20) NOT NULL,
PRIMARY KEY `captcha_id` (`captcha_id`),
KEY `word` (`word`)
);