forked from StratumAuhuur/CTFPad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ctfpad.sql
32 lines (32 loc) · 807 Bytes
/
ctfpad.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
CREATE TABLE "ctf" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
"name" TEXT NOT NULL
);
CREATE TABLE "challenge" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
"title" TEXT NOT NULL,
"category" TEXT NOT NULL,
"points" INTEGER NOT NULL,
"done" INTEGER NOT NULL DEFAULT (0),
"ctf" INTEGER NOT NULL
);
CREATE TABLE "assigned" (
"user" TEXT NOT NULL,
"challenge" INTEGER NOT NULL
);
CREATE TABLE user (
"name" TEXT PRIMARY KEY NOT NULL,
"pwhash" TEXT NOT NULL,
"sessid" TEXT,
"scope" INTEGER NOT NULL DEFAULT (0),
"apikey" TEXT
);
CREATE TABLE file (
"id" TEXT PRIMARY KEY NOT NULL,
"name" TEXT NOT NULL,
"user" INTEGER NOT NULL,
"ctf" INTEGER,
"challenge" INTEGER,
"uploaded" INTEGER NOT NULL DEFAULT (0),
"mimetype" TEXT DEFAULT ('application/octet-stream; charset=binary')
);