-- Some comments needes
User json
    ident          (CI Text)
    authentication AuthenticationMode
    lastAuthentication UTCTime Maybe
    matrikelnummer Text Maybe
    email          (CI Text)
    displayName    Text            -- we always show the LDAP displayName only, but highlight the LDAP surname within (or appended if not contained)
    surname        Text            -- Name displayed through 'nameWidget displayName surname' which highlights surname within displayName
    maxFavourites  Int default=12  -- Number of last used course names to be remembered for quick links for convenience
    theme          Theme default='Default'
    dateTimeFormat DateTimeFormat "default='%a %d %b %Y %R'"
    dateFormat     DateTimeFormat "default='%d.%m.%Y'"
    timeFormat     DateTimeFormat "default='%R'"
    downloadFiles  Bool default=false          -- Files should be opened in browser or downloaded
    mailLanguages  MailLanguages default='[]'
    notificationSettings NotificationSettings  -- Bit-array for which events email notification is requested by user
    UniqueAuthentication ident
    UniqueEmail email
    deriving Show Eq Generic
UserAdmin
    user   UserId
    school SchoolId
    UniqueUserAdmin user school
UserLecturer
    user   UserId
    school SchoolId
    UniqueSchoolLecturer user school
StudyFeatures  -- Abschluss, Studiengang, Haupt/Nebenfachh und Fachsemester
    user          UserId
    degree        StudyDegreeId
    field         StudyTermsId
    type          StudyFieldType
    semester      Int
    updated       UTCTime default='NOW()' -- zuletzt als gültig gesehen
    valid         Bool default=true
    UniqueStudyFeatures user degree field type semester
    -- UniqueUserSubject ubuser degree field -- There exists a counterexample
StudyDegree   -- Studienabschluss
    key           Int
    shorthand     Text Maybe
    name          Text Maybe
    Primary key
StudyTerms    -- Studiengang
    key           Int
    shorthand     Text Maybe
    name          Text Maybe
    Primary key
StudyTermCandidate
    incidence     UUID     --random id per login to associate matching pairs
    key           Int
    name          Text
    deriving Show Eq Ord