-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sql
More file actions
31 lines (29 loc) · 759 Bytes
/
init.sql
File metadata and controls
31 lines (29 loc) · 759 Bytes
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
create table user(
uid integer primary key auto_increment,
email varchar(30) not null unique,
username varchar(30) not null unique,
password varchar(60) not null,
salt varchar(10) not null,
op tinyint default 0,
ban tinyint default 0
);
create table task(
tid integer primary key auto_increment,
owner integer default 0,
title varchar(60),
description text,
level smallint default 13,
foreign key (owner) references user(uid)
);
create table submission(
sid integer primary key auto_increment,
tid integer,
uid integer,
language varchar(10),
code text,
result varchar(200) default 'Pending',
score numeric default 0,
submit_time datetime default now(),
foreign key (tid) references task(tid),
foreign key (uid) references user(uid)
);