{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# OPTIONS_GHC -Wno-duplicate-exports #-}
{-# LANGUAGE CPP #-}
#if MIN_VERSION_persistent_template(2,7,2)
{-# LANGUAGE UndecidableInstances #-}
#endif
#if MIN_VERSION_persistent_template(2,8,0)
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE StandaloneDeriving #-}
#endif
module Exigo.Persistent.Schema
(
Student(..)
, StudentId
, Submission(..)
, SubmissionId
, LatePenalty(..)
, LatePenaltyId
, savedMainModel
, Key(StudentKey,SubmissionKey
,LatePenaltyKey
,unStudentKey,unLatePenaltyKey
,unSubmissionKey)
, StudentKey
, SubmissionKey
, LatePenaltyKey
, module Exigo.Persistent.Schema
)
where
import Data.Aeson ()
import Data.Binary
import Data.Text (Text)
import Database.Persist.TH (
mkPersist
, mkSave
, persistFileWith
, share
, sqlSettings
)
import Database.Persist.Quasi
import Database.Persist.Class
import GHC.Generics
share [
mkSave "savedMainModel"
, mkPersist sqlSettings
]
$(persistFileWith lowerCaseSettings "config/exigo.persistentmodels")
instance Binary Student where
deriving instance Generic (Key Student)
instance Binary (Key Student) where
instance Binary Submission where
instance Binary LatePenalty where
type StudentKey = Key Student
type LatePenaltyKey = Key LatePenalty
type SubmissionKey = Key Submission