-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakeSQLite.sh
More file actions
executable file
·29 lines (29 loc) · 902 Bytes
/
Copy pathmakeSQLite.sh
File metadata and controls
executable file
·29 lines (29 loc) · 902 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
#!/bin/bash
rm mark_two_db.sqlt
sqlite3 mark_two_db.sqlt "CREATE TABLE Answers (
contract TEXT NOT NULL,
testee TEXT NOT NULL,
answer TEXT,
score INTEGER,
score_confirmed INTEGER DEFAULT 1);"
sqlite3 mark_two_db.sqlt "CREATE TABLE Tasks (
contract TEXT NOT NULL,
owner TEXT NOT NULL,
question TEXT NOT NULL,
corrector TEXT NOT NULL,
keyword TEXT NOT NULL,
maxscore INTEGER NOT NULL,
created_utc TEXT DEFAULT CURRENT_TIMESTAMP,
end_utc TEXT NOT NULL,
token_address TEXT NOT NULL,
token_amount INTEGER DEFAULT 0,
token_confirmed INTEGER DEFAULT 1,
state TEXT DEFAULT \"o\");"
# state is enum with 4 possible values:
# - o = online
# - op = online and incentiviced (payed)
# - f = finished (now > end_utc)
# - fp = finished and payed out (reward payed out to corrector)
sqlite3 mark_two_db.sqlt "CREATE TABLE TasksTransactions (
hash TEXT NOT NULL,
confirmed INTEGER DEFAULT 0);"