DegreeCourse json   -- for which degree programmes this course is appropriate for
    course       CourseId
    degree       StudyDegreeId
    terms        StudyTermsId
    UniqueDegreeCourse course degree terms
Course    -- Information about a single course; contained info is always visible to all users
    name             (CI Text)
    description      Html Maybe    -- user-defined large Html, ought to contain module description
    linkExternal     Text Maybe    -- arbitrary user-defined url for external course page
    shorthand        (CI Text)     -- practical shorthand of course name, used for identification
    term             TermId        -- semester this course is taught
    school           SchoolId
    capacity         Int Maybe   -- number of allowed enrolements, if restricted
    -- canRegisterNow = maybe False (<= currentTime) registerFrom && maybe True (>= currentTime) registerTo
    registerFrom     UTCTime Maybe -- enrolement allowed from a given day onwwards or prohibited
    registerTo       UTCTime Maybe -- enrolement may be prohibited from a given date onwards
    deregisterUntil  UTCTime Maybe -- unenrolement may be prohibited from a given date onwards
    registerSecret   Text Maybe    -- enrolement maybe protected by a simple common passphrase
    materialFree     Bool          -- False: only enrolled users may see course materials not stored in this table
    TermSchoolCourseShort  term school shorthand    -- shorthand must be unique within school and semester
    TermSchoolCourseName   term school name         -- name must be unique within school and semester
    deriving Generic
CourseEdit                -- who edited when a row in table "Course", kept indefinitely (might be replaced by generic Audit Table; like all ...-Edit tables)
    user         UserId
    time         UTCTime
    course       CourseId
CourseFavourite           -- which user accessed which course when, only displayed to user for convenience;
    user         UserId   -- max number of rows kept per user is user-defined by column 'maxFavourites' in table "User"
    time         UTCTime  -- oldest is removed first
    course       CourseId
    UniqueCourseFavourite user course
    deriving Show
Lecturer                       -- course ownership
    user         UserId
    course       CourseId
    type         LecturerType  default='"lecturer"'
    UniqueLecturer user course -- note: multiple lecturers per course are allowed, but no duplicated rows in this table
CourseParticipant                      -- course enrolement
    course       CourseId
    user         UserId
    registration UTCTime               -- time of last enrolement for this course
    field        StudyFeaturesId Maybe -- associated degree course, user-defined; required for communicating grades
    UniqueParticipant user course
-- Replace the last two by the following, once an audit log is available
-- CourseUserNote                 -- lecturers of a specific course may share a text note on each enrolled student
--     course       CourseId
--     user         UserId
--     note         Html          -- arbitrary user-defined text; visible only to lecturer of this course
--     time         UTCTime       -- PROBLEM: deleted note has no modification date
--     editor       UserId        -- who edited this note last
--     UniqueCourseUserNote user course
CourseUserNote                 -- lecturers of a specific course may share a text note on each enrolled student
    course       CourseId
    user         UserId
    note         Html          -- arbitrary user-defined text; visible only to lecturer of this course
    UniqueCourseUserNote user course
CourseUserNoteEdit             -- who edited a participants course note when
    user         UserId
    time         UTCTime
    note         CourseUserNoteId -- PROBLEM: deleted notes have no modification date any more
