-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCREATE_TABLE.sql
114 lines (101 loc) · 3.39 KB
/
CREATE_TABLE.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
CREATE TABLE `chats` (
`mid` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL,
`msg` text COLLATE utf8_unicode_ci NOT NULL,
`status` int(11) NOT NULL,
`ts` bigint(20) DEFAULT NULL,
PRIMARY KEY (`mid`)
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `const` (
`var` varchar(14) NOT NULL,
`content` text NOT NULL,
PRIMARY KEY (`var`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `contest_problem` (
`cid` int(11) NOT NULL,
`pid` int(11) NOT NULL,
PRIMARY KEY (`cid`,`pid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `contest_special` (
`cid` int(11) NOT NULL,
`pid` int(11) NOT NULL,
PRIMARY KEY (`cid`,`pid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `contest_user` (
`cid` int(11) NOT NULL,
`uid` int(11) NOT NULL,
PRIMARY KEY (`cid`,`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `contests` (
`cid` int(11) NOT NULL AUTO_INCREMENT,
`pub` int(11) NOT NULL,
`ts1` bigint(20) DEFAULT NULL,
`ts2` bigint(20) DEFAULT NULL,
`ttl` text NOT NULL,
PRIMARY KEY (`cid`)
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
CREATE TABLE `exam_scores` (
`uid` int(11) NOT NULL,
`eid` int(11) NOT NULL,
`score` int(11) NOT NULL,
PRIMARY KEY (`uid`,`eid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `exams` (
`eid` int(11) NOT NULL AUTO_INCREMENT,
`ttl` text COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`eid`)
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `level_domain` (
`did` int(11) NOT NULL,
`level` int(11) NOT NULL,
PRIMARY KEY (`did`,`level`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `levels` (
`level` int(11) NOT NULL AUTO_INCREMENT,
`ttl` text COLLATE utf8_unicode_ci,
`lorder` int(11) DEFAULT NULL,
PRIMARY KEY (`level`)
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `problem_dependency` (
`pid` int(11) DEFAULT NULL,
`depend_pid` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `problems` (
`pid` int(11) NOT NULL AUTO_INCREMENT,
`pub` int(11) NOT NULL,
`ts` bigint(20) DEFAULT NULL,
`src` text COLLATE utf8_unicode_ci NOT NULL,
`ttl` text COLLATE utf8_unicode_ci NOT NULL,
`level` int(11) DEFAULT NULL,
`porder` int(11) DEFAULT NULL,
PRIMARY KEY (`pid`)
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `submissions` (
`sid` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL,
`pid` int(11) NOT NULL,
`cid` int(11) NOT NULL,
`ts` bigint(20) DEFAULT NULL,
`lng` int(11) NOT NULL,
`len` int(11) NOT NULL,
`scr` int(11) NOT NULL,
`res` int(11) NOT NULL,
`cpu` int(11) NOT NULL,
`mem` int(11) NOT NULL,
PRIMARY KEY (`sid`)
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
CREATE TABLE `users` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`ts1` bigint(20) DEFAULT NULL,
`ts2` bigint(20) DEFAULT NULL,
`lgn` char(255) NOT NULL,
`pwd` mediumtext NOT NULL,
`motto` mediumtext DEFAULT NULL,
`email` mediumtext NOT NULL,
`nname` mediumtext DEFAULT NULL,
`ename` mediumtext DEFAULT NULL,
`class` char(255) DEFAULT NULL,
`ip` char(255) DEFAULT NULL,
PRIMARY KEY (`uid`),
UNIQUE KEY `lgn` (`lgn`)
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;