forked from Jinmo/AssemblyLearner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sql
38 lines (35 loc) · 839 Bytes
/
init.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
CREATE TABLE IF NOT EXISTS user (
id CHAR(20) PRIMARY KEY,
password CHAR(40),
role CHAR(10) DEFAULT 'member'
);
CREATE TABLE IF NOT EXISTS problem (
id INTEGER PRIMARY Key AUTOINCREMENT ,
name CHAR(200) UNIQUE,
instruction TEXT,
answer_regex TEXT,
suffix TEXT,
example TEXT,
status CHAR(10),
category CHAR(50),
input TEXT,
hint TEXT,
createdAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS solved (
id INTEGER PRIMARY Key AUTOINCREMENT,
problem INTEGER,
owner CHAR(200),
/* FAIL, CORRECT */
status CHAR(10),
answer TEXT,
errmsg TEXT,
time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS snippets (
id INTEGER PRIMARY Key AUTOINCREMENT ,
filename TEXT UNIQUE,
code TEXT,
owner CHAR(200)
);