From c48e1e1981a1682618a2511983f91459a3e53763 Mon Sep 17 00:00:00 2001 From: SJost Date: Wed, 27 Feb 2019 13:11:40 +0100 Subject: [PATCH] StudyFields start --- models/courses | 1 + models/users | 1 + src/Foundation.hs | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/models/courses b/models/courses index 96bba0195..55c1daa86 100644 --- a/models/courses +++ b/models/courses @@ -38,6 +38,7 @@ CourseParticipant course CourseId user UserId registration UTCTime + field StudyFeaturesId Maybe UniqueParticipant user course CourseUserNote course CourseId diff --git a/models/users b/models/users index 5ac4a6a3c..94f1cb559 100644 --- a/models/users +++ b/models/users @@ -30,6 +30,7 @@ StudyFeatures field StudyTermsId type StudyFieldType semester Int + updated UTCTime default=now -- zuletzt als gültig gesehen -- UniqueUserSubject user degree field -- There exists a counterexample StudyDegree key Int diff --git a/src/Foundation.hs b/src/Foundation.hs index e4de524d2..45ef28c0d 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -2018,7 +2018,8 @@ instance YesodAuth UniWorX where return str fs <- either (\err -> throwError . ServerError $ "Could not parse features of study: " <> err) return userStudyFeatures - + -- TODO: just update StudyFeaturesUpdate in case of no-change + -- TODO: keep old is referenced in CourseParticipant lift $ deleteWhere [StudyFeaturesUser ==. userId] forM_ fs $ \StudyFeatures{..} -> do