Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bwinf
medal
Commits
b652144b
Commit
b652144b
authored
Jul 30, 2019
by
Robert Czechowski
Browse files
Add initial database migrations for PostgreSQL
parent
e2304146
Changes
8
Hide whitespace changes
Inline
Side-by-side
migrations/postgres/0001_create_contest.sql
0 → 100644
View file @
b652144b
CREATE
TABLE
contest
(
id
SERIAL
PRIMARY
KEY
,
location
TEXT
NOT
NULL
,
filename
TEXT
NOT
NULL
,
name
TEXT
NOT
NULL
,
duration
INTEGER
NOT
NULL
,
public
BOOL
NOT
NULL
,
start_date
TIMESTAMP
,
end_date
TIMESTAMP
)
migrations/postgres/0001_create_grade.sql
0 → 100644
View file @
b652144b
CREATE
TABLE
grade
(
taskgroup
INTEGER
,
session
INTEGER
,
grade
INTEGER
,
validated
BOOL
,
PRIMARY
KEY
(
taskgroup
,
session
)
)
migrations/postgres/0001_create_group.sql
0 → 100644
View file @
b652144b
CREATE
TABLE
usergroup
(
id
SERIAL
PRIMARY
KEY
,
name
TEXT
,
groupcode
TEXT
,
tag
TEXT
,
admin
INTEGER
)
migrations/postgres/0001_create_participation.sql
0 → 100644
View file @
b652144b
CREATE
TABLE
participation
(
contest
INTEGER
,
session
INTEGER
,
start_date
TIMESTAMP
,
PRIMARY
KEY
(
contest
,
session
)
)
migrations/postgres/0001_create_session_user.sql
0 → 100644
View file @
b652144b
CREATE
TABLE
session
(
id
SERIAL
PRIMARY
KEY
,
session_token
TEXT
,
csrf_token
TEXT
,
last_login
TIMESTAMP
,
last_activity
TIMESTAMP
,
permanent_login
BOOL
,
username
TEXT
,
password
TEXT
,
salt
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
BOOL
,
managed_by
INTEGER
,
oauth_foreign_id
TEXT
,
oauth_provider
TEXT
)
migrations/postgres/0001_create_submission.sql
0 → 100644
View file @
b652144b
CREATE
TABLE
submission
(
id
SERIAL
PRIMARY
KEY
,
session
INTEGER
NOT
NULL
,
task
INTEGER
NOT
NULL
,
grade
INTEGER
NOT
NULL
,
validated
BOOL
NOT
NULL
,
needs_validation
BOOL
NOT
NULL
,
nonvalidated_grade
INTEGER
NOT
NULL
,
subtask_identifier
TEXT
,
value
TEXT
,
date
TIMESTAMP
)
migrations/postgres/0001_create_task.sql
0 → 100644
View file @
b652144b
CREATE
TABLE
task
(
id
SERIAL
PRIMARY
KEY
,
taskgroup
INTEGER
,
location
TEXT
,
stars
INTEGER
)
migrations/postgres/0001_create_taskgroup.sql
0 → 100644
View file @
b652144b
CREATE
TABLE
taskgroup
(
id
SERIAL
PRIMARY
KEY
,
contest
INTEGER
NOT
NULL
,
name
TEXT
NOT
NULL
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment