-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.sql
More file actions
55 lines (50 loc) · 1.81 KB
/
schema.sql
File metadata and controls
55 lines (50 loc) · 1.81 KB
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
CREATE TABLE IF NOT EXISTS `problem_test_cases` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`problem_id` int(11) NOT NULL,
`input_text` mediumtext NOT NULL,
`output_text` mediumtext NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `problems`;
CREATE TABLE `problems` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`contest_id` int(11) NOT NULL,
`title` text,
`problem_html` mediumtext NOT NULL,
`run_timelimit_seconds` int(11) NOT NULL,
`point` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `sessions` (
`session_id` varchar(128) NOT NULL,
`user_id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`expire_at` datetime NOT NULL,
PRIMARY KEY (`session_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `submissions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`problem_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`language` varchar(32) NOT NULL,
`source_code` longblob NOT NULL,
`judge_status` varchar(32) NOT NULL,
`judge_server` varchar(128) NOT NULL,
`judge_start_time` datetime NOT NULL,
`judge_end_time` datetime NOT NULL,
`execution_time` int(11) NOT NULL,
`build_time` int(11) NOT NULL DEFAULT '0',
`memory_used_in_kb` int(11) DEFAULT NULL,
`error_message` varchar(1024) NOT NULL DEFAULT '',
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`screen_name` varchar(32) NOT NULL,
`email` varchar(255) NOT NULL,
`passwd` varchar(512) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `screen_name` (`screen_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;