-
Notifications
You must be signed in to change notification settings - Fork 17
/
create_contest_db.sql
68 lines (62 loc) · 1.83 KB
/
create_contest_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
-- Copyright (c) Facebook, Inc. and its affiliates.
--
-- This source code is licensed under the MIT license found in the
-- LICENSE file in the root directory of this source tree.
CREATE TABLE test_events (
event_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
job_id BIGINT(20) NOT NULL,
run_id BIGINT(20) NOT NULL,
test_name VARCHAR(32) NULL,
test_step_label VARCHAR(32) NULL,
event_name VARCHAR(32) NULL,
target_name VARCHAR(64) NULL,
target_id VARCHAR(64) NULL,
payload TEXT NULL,
emit_time TIMESTAMP NOT NULL,
PRIMARY KEY (event_id)
);
CREATE TABLE framework_events (
event_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
job_id BIGINT(20) NOT NULL,
event_name VARCHAR(32) NULL,
payload TEXT NULL,
emit_time TIMESTAMP NOT NULL,
PRIMARY KEY (event_id)
);
CREATE TABLE run_reports (
report_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
job_id BIGINT(20) NOT NULL,
run_id BIGINT(20) NOT NULL,
reporter_name VARCHAR(32) NOT NULL,
success TINYINT(1) NULL,
report_time TIMESTAMP NOT NULL,
data TEXT NOT NULL,
PRIMARY KEY (report_id)
);
CREATE TABLE final_reports (
report_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
job_id BIGINT(20) NOT NULL,
success TINYINT(1) NULL,
reporter_name VARCHAR(32) NOT NULL,
report_time TIMESTAMP NOT NULL,
data TEXT NOT NULL,
PRIMARY KEY (report_id)
);
CREATE TABLE jobs (
job_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(64) NOT NULL,
requestor VARCHAR(32) NOT NULL,
server_id VARCHAR(64) NOT NULL,
request_time TIMESTAMP NOT NULL,
descriptor TEXT NOT NULL,
teststeps TEXT,
PRIMARY KEY (job_id)
);
CREATE TABLE locks (
target_id VARCHAR(64) NOT NULL,
job_id BIGINT(20) UNSIGNED NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
expires_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
valid BOOL NOT NULL DEFAULT TRUE,
PRIMARY KEY (target_id)
);