-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·60 lines (53 loc) · 1.84 KB
/
install.sh
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
#!/bin/bash
host="localhost"
port="3306"
user="root"
password="123456"
dbname="beego_judge"
raw_sql="
CREATE TABLE IF NOT EXISTS submit_status (
runid INT NOT NULL,
matchid INT,
matchidx VARCHAR(8),
remote_runid INT NOT NULL,
username VARCHAR(20) NOT NULL,
oj VARCHAR(20) NOT NULL,
problemid VARCHAR(10) NOT NULL,
result VARCHAR(20) NOT NULL,
result_code INT NOT NULL,
execute_time VARCHAR(20),
memory VARCHAR(20),
language VARCHAR(10) NOT NULL,
length INT NOT NULL,
submit_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (runid)
)character set = utf8;
"
mysql -h${host} -P${port} -u${user} -p${password} -D ${dbname} -e "${raw_sql}"
# raw_sql="DROP TABLE user_info";
# mysql -h${host} -P${port} -u${user} -p${password} -D ${dbname} -e "${raw_sql}"
raw_sql="
CREATE TABLE IF NOT EXISTS user_info (
username VARCHAR(20) NOT NULL,
password VARCHAR(32) NOT NULL,
nickname VARCHAR(20) NOT NULL,
register_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (username)
)character set utf8;
"
mysql -h${host} -P${port} -u${user} -p${password} -D ${dbname} -e "${raw_sql}"
raw_sql="
CREATE TABLE IF NOT EXISTS contest (
matchid INT NOT NULL,
title VARCHAR(32) NOT NULL,
onwer VARCHAR(20) NOT NULL,
descr VARCHAR(128) NOT NULL,
problem VARCHAR(128) NOT NULL,
problem_title VARCHAR(128) NOT NULL,
begin_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
end_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (matchid)
)character set utf8;
"
mysql -h${host} -P${port} -u${user} -p${password} -D ${dbname} -e "${raw_sql}"