Datanbank: Model cleanup

This commit is contained in:
SJost 2018-04-03 16:20:29 +02:00
parent 9a26d17c5e
commit ebf4c841eb
2 changed files with 21 additions and 20 deletions

View File

@ -101,7 +101,7 @@ psql -U uniworx -d uniworx -h 127.0.0.1 -w
\dt
--Zeige Tabellen Inhalt:
TABEL "user";
TABLE "user";
-- Die Anführungszeichen können manchmal weggelassen werden, aber
-- bei user sind sie notwendig, da es auch Schlüsselwort in sql ist.

39
models
View File

@ -44,15 +44,11 @@ School json
shorthand Text
UniqueSchool name
deriving Eq
Degree json
name Text
schoolId SchoolId
UniqueDegree name schoolId
deriving Eq
DegreeCourse json
degreeId DegreeId
courseId CourseId
UniqueDegreeCourse degreeId courseId
course CourseId
degree StudyDegreeId
terms StudyTermsId
UniqueDegreeCourse course degree terms
Course
name Text
description Html Maybe
@ -69,6 +65,10 @@ CourseEdit
user UserId
time UTCTime
course CourseId
CourseFavourite
user UserId
time UTCTime
course CourseId
Lecturer
userId UserId
courseId CourseId
@ -154,7 +154,7 @@ SubmissionGroupUser
Tutorial json
name Text
tutor UserId
course CourseId -- ?
course CourseId
TutorialUser
userId UserId
tutorialId TutorialId
@ -185,6 +185,7 @@ Room
tutorialId TutorialId
examId ExamId
-- data RoomFor = RoomForCourseIdSum CourseId | RoomForTutorialIdSum TutorialId ...
-- EXAMS ARE TODO:
Exam
courseId CourseId
name Text
@ -196,13 +197,13 @@ Exam
deregistrationEnd UTCTime
ratingVisible Bool
statisticsVisible Bool
ExamEdit
user UserId
time UTCTime
exam ExamId
ExamUser
userId UserId
examId ExamId
-- CONTINUE HERE: Include rating in this table or separately?
UniqueExamUser userId examId
-- By default this file is used in Model.hs (which is imported by Foundation.hs)
--ExamEdit
-- user UserId
-- time UTCTime
-- exam ExamId
--ExamUser
-- userId UserId
-- examId ExamId
-- -- CONTINUE HERE: Include rating in this table or separately?
-- UniqueExamUser userId examId
-- By default this file is used in Model.hs (which is imported by Foundation.hs)