Commit 4f12f60e authored by Robert Czechowski's avatar Robert Czechowski
Browse files

SQLITE database migrations

parent 407dc9d4
CREATE TABLE contest (
id INTEGER PRIMARY KEY,
location TEXT NOT NULL,
filename TEXT NOT NULL,
name TEXT NOT NULL,
duration INTEGER NOT NULL,
public INTEGER NOT NULL,
start_date TEXT,
end_date TEXT
)
CREATE TABLE grade (
taskgroup INTEGER,
user INTEGER,
grade INTEGER,
validated INTEGER,
PRIMARY KEY (taskgroup, user)
)
CREATE TABLE participation (
contest INTEGER,
user INTEGER,
start_date TEXT,
PRIMARY KEY (contest, user)
)
CREATE TABLE session_user (
id INTEGER PRIMARY KEY,
session_token TEXT,
csrf_token TEXT,
last_login TEXT,
last_activity TEXT,
permanent_login INTEGER,
username TEXT,
password TEXT,
logincode TEXT,
email TEXT,
email_unconfirmed TEXT,
email_confirmationcode TEXT,
firstname TEXT,
lastname TEXT,
street TEXT,
zip TEXT,
city TEXT,
nation TEXT,
grade INTEGER,
is_teacher INTEGER,
managed_by INTEGER,
pms_id INTEGER,
pms_school_id INTEGER
)
CREATE TABLE submission (
id INTEGER PRIMARY KEY,
session_user INTEGER NOT NULL,
task INTEGER NOT NULL,
contest INTEGER NOT NULL,
grade INTEGER NOT NULL,
validated INTEGER NOT NULL,
nonvalidated_grade INTEGER NOT NULL,
subtask_identifier TEXT,
value TEXT,
date TEXT
)
CREATE TABLE task (
id INTEGER PRIMARY KEY,
taskgroup INTEGER,
location TEXT,
stars INTEGER
)
CREATE TABLE taskgroup (
id INTEGER PRIMARY KEY,
contest INTEGER NOT NULL,
name TEXT NOT NULL
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment