Skip to content

Commit

Permalink
添加用来自动创建数据库的 db.sql
Browse files Browse the repository at this point in the history
  • Loading branch information
interestingLSY committed May 24, 2019
1 parent db81956 commit 7b77c74
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 4 deletions.
77 changes: 77 additions & 0 deletions db.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
CREATE DATABASE intoj CHARACTER SET utf8;
use intoj;
CREATE TABLE zisheng(
id INT NOT NULL PRIMARY KEY auto_increment,
username VARCHAR(20),
message TEXT,
send_time VARCHAR(50)
);
CREATE TABLE contests(
id INT NOT NULL PRIMARY KEY auto_increment,
title VARCHAR(100),
subtitle VARCHAR(100),
begin_time VARCHAR(50),
end_time VARCHAR(50),
description TEXT,
rule TEXT,
holder_name VARCHAR(20),
problems TEXT,
admins TEXT
);
CREATE TABLE contest_players(
id INT NOT NULL PRIMARY KEY auto_increment,
username VARCHAR(20),
contest_id INT,
detail TEXT
);
CREATE TABLE problems(
`id` BIGINT NOT NULL PRIMARY KEY auto_increment,
`title` VARCHAR(100),
`description` TEXT,
`input_format` TEXT,
`output_format` TEXT,
`example` TEXT,
`limit_and_hint` TEXT,
`time_limit` BIGINT,
`memory_limit` BIGINT,
`is_public` TINYINT(1) DEFAULT 1
);
CREATE TABLE records(
`id` BIGINT(20) NOT NULL PRIMARY KEY auto_increment,
`problem_id` BIGINT(20) NOT NULL,
`code` MEDIUMTEXT,
`language` VARCHAR(50),
`status` INT,
`score` DOUBLE,
`compilation` LONGTEXT,
`result` LONGTEXT,
`time_usage` INT,
`memory_usage` INT,
`system_message` TEXT,
`username` VARCHAR(20),
`contest_id` INT,
`submit_time` VARCHAR(50)
);
CREATE TABLE users(
`id` INT(11) NOT NULL PRIMARY KEY auto_increment,
`username` VARCHAR(20),
`password_sha256` VARCHAR(170),
`password_sha1` VARCHAR(170),
`email` VARCHAR(100),
`sex` INT(2),
`signature` TEXT,
`group` VARCHAR(100),
`background_url` VARCHAR(200),
`total_ac` INT(10),
`total_submit` INT(10),
`ac_list` TEXT
);
CREATE TABLE user_privileges(
`id` INT(11) NOT NULL PRIMARY KEY auto_increment,
`username` VARCHAR(20),
`is_admin` TINYINT(1) default 0,
`is_user_manager` TINYINT(1) default 0,
`is_problem_manager` TINYINT(1) default 0,
`is_contest_manager` TINYINT(1) default 0,
`is_tag_manager` TINYINT(1) default 0
);
8 changes: 4 additions & 4 deletions document/网页端名字列表.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CREATE TABLE problems(
`time_limit` BIGINT,
`memory_limit` BIGINT,
`is_public` TINYINT(1) DEFAULT 1
) CHARACTER SET utf8;
);
```

---
Expand Down Expand Up @@ -65,7 +65,7 @@ CREATE TABLE records(
`username` VARCHAR(20),
`contest_id` INT,
`submit_time` VARCHAR(50)
) CHARACTER SET utf8;
);
```

其中result为json,大概长这样:
Expand Down Expand Up @@ -111,7 +111,7 @@ CREATE TABLE users(
`total_ac` INT(10),
`total_submit` INT(10),
`ac_list` TEXT
) CHARACTER SET utf8;
);
```

---
Expand All @@ -137,5 +137,5 @@ CREATE TABLE user_privileges(
`is_problem_manager` TINYINT(1) default 0,
`is_contest_manager` TINYINT(1) default 0,
`is_tag_manager` TINYINT(1) default 0
) CHARACTER SET utf8;
);
```

0 comments on commit 7b77c74

Please sign in to comment.