forked from svn2github/hustoj
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb.sql
executable file
·188 lines (166 loc) · 5.95 KB
/
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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
set names utf8;
create database jol;
use jol;
CREATE TABLE `compileinfo` (
`solution_id` int(11) NOT NULL DEFAULT '0',
`error` text,
PRIMARY KEY (`solution_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `contest` (
`contest_id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) DEFAULT NULL,
`start_time` datetime DEFAULT NULL,
`end_time` datetime DEFAULT NULL,
`defunct` char(1) NOT NULL DEFAULT 'N',
`description` text,
`private` tinyint(4) NOT NULL DEFAULT '0',
`langmask` int NOT NULL DEFAULT '0' COMMENT 'bits for LANG to mask',
PRIMARY KEY (`contest_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8;
CREATE TABLE `contest_problem` (
`problem_id` int(11) NOT NULL DEFAULT '0',
`contest_id` int(11) DEFAULT NULL,
`title` char(200) NOT NULL DEFAULT '',
`num` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `loginlog` (
`user_id` varchar(48) NOT NULL DEFAULT '',
`password` varchar(40) DEFAULT NULL,
`ip` varchar(100) DEFAULT NULL,
`time` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `mail` (
`mail_id` int(11) NOT NULL AUTO_INCREMENT,
`to_user` varchar(48) NOT NULL DEFAULT '',
`from_user` varchar(48) NOT NULL DEFAULT '',
`title` varchar(200) NOT NULL DEFAULT '',
`content` text,
`new_mail` tinyint(1) NOT NULL DEFAULT '1',
`reply` tinyint(4) DEFAULT '0',
`in_date` datetime DEFAULT NULL,
`defunct` char(1) NOT NULL DEFAULT 'N',
PRIMARY KEY (`mail_id`),
KEY `uid` (`to_user`)
) ENGINE=MyISAM AUTO_INCREMENT=1013 DEFAULT CHARSET=utf8;
CREATE TABLE `news` (
`news_id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` varchar(48) NOT NULL DEFAULT '',
`title` varchar(200) NOT NULL DEFAULT '',
`content` text NOT NULL,
`time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`importance` tinyint(4) NOT NULL DEFAULT '0',
`defunct` char(1) NOT NULL DEFAULT 'N',
PRIMARY KEY (`news_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1004 DEFAULT CHARSET=utf8;
CREATE TABLE `privilege` (
`user_id` char(48) NOT NULL DEFAULT '',
`rightstr` char(30) NOT NULL DEFAULT '',
`defunct` char(1) NOT NULL DEFAULT 'N'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `problem` (
`problem_id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(200) NOT NULL DEFAULT '',
`description` text,
`input` text,
`output` text,
`sample_input` text,
`sample_output` text,
`spj` char(1) NOT NULL DEFAULT '0',
`hint` text,
`source` varchar(100) DEFAULT NULL,
`in_date` datetime DEFAULT NULL,
`time_limit` int(11) NOT NULL DEFAULT '0',
`memory_limit` int(11) NOT NULL DEFAULT '0',
`defunct` char(1) NOT NULL DEFAULT 'N',
`accepted` int(11) DEFAULT '0',
`submit` int(11) DEFAULT '0',
`solved` int(11) DEFAULT '0',
PRIMARY KEY (`problem_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8;
CREATE TABLE `reply` (
`rid` int(11) NOT NULL AUTO_INCREMENT,
`author_id` varchar(48) NOT NULL,
`time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`content` text NOT NULL,
`topic_id` int(11) NOT NULL,
`status` int(2) NOT NULL DEFAULT '0',
`ip` varchar(30) NOT NULL,
PRIMARY KEY (`rid`),
KEY `author_id` (`author_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `sim` (
`s_id` int(11) NOT NULL,
`sim_s_id` int(11) DEFAULT NULL,
`sim` int(11) DEFAULT NULL,
PRIMARY KEY (`s_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `solution` (
`solution_id` int(11) NOT NULL AUTO_INCREMENT,
`problem_id` int(11) NOT NULL DEFAULT '0',
`user_id` char(48) NOT NULL,
`time` int(11) NOT NULL DEFAULT '0',
`memory` int(11) NOT NULL DEFAULT '0',
`in_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`result` smallint(6) NOT NULL DEFAULT '0',
`language` INT UNSIGNED NOT NULL DEFAULT '0',
`ip` char(15) NOT NULL,
`contest_id` int(11) DEFAULT NULL,
`valid` tinyint(4) NOT NULL DEFAULT '1',
`num` tinyint(4) NOT NULL DEFAULT '-1',
`code_length` int(11) NOT NULL DEFAULT '0',
`judgetime` datetime DEFAULT NULL,
`pass_rate` DECIMAL(2,2) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`solution_id`),
KEY `uid` (`user_id`),
KEY `pid` (`problem_id`),
KEY `res` (`result`),
KEY `cid` (`contest_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1001 DEFAULT CHARSET=utf8;
CREATE TABLE `source_code` (
`solution_id` int(11) NOT NULL,
`source` text NOT NULL,
PRIMARY KEY (`solution_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `topic` (
`tid` int(11) NOT NULL AUTO_INCREMENT,
`title` varbinary(60) NOT NULL,
`status` int(2) NOT NULL DEFAULT '0',
`top_level` int(2) NOT NULL DEFAULT '0',
`cid` int(11) DEFAULT NULL,
`pid` int(11) NOT NULL,
`author_id` varchar(48) NOT NULL,
PRIMARY KEY (`tid`),
KEY `cid` (`cid`,`pid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `users` (
`user_id` varchar(48) NOT NULL DEFAULT '',
`email` varchar(100) DEFAULT NULL,
`submit` int(11) DEFAULT '0',
`solved` int(11) DEFAULT '0',
`defunct` char(1) NOT NULL DEFAULT 'N',
`ip` varchar(20) NOT NULL DEFAULT '',
`accesstime` datetime DEFAULT NULL,
`volume` int(11) NOT NULL DEFAULT '1',
`language` int(11) NOT NULL DEFAULT '1',
`password` varchar(32) DEFAULT NULL,
`reg_time` datetime DEFAULT NULL,
`nick` varchar(100) NOT NULL DEFAULT '',
`school` varchar(100) NOT NULL DEFAULT '',
PRIMARY KEY (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `online` (
`hash` varchar(32) collate utf8_unicode_ci NOT NULL,
`ip` varchar(20) character set utf8 NOT NULL default '',
`ua` varchar(255) character set utf8 NOT NULL default '',
`refer` varchar(255) collate utf8_unicode_ci default NULL,
`lastmove` int(10) NOT NULL,
`firsttime` int(10) default NULL,
`uri` varchar(255) collate utf8_unicode_ci default NULL,
PRIMARY KEY (`hash`),
UNIQUE KEY `hash` (`hash`)
) ENGINE=MEMORY DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `runtimeinfo` (
`solution_id` int(11) NOT NULL DEFAULT '0',
`error` text,
PRIMARY KEY (`solution_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;