{-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module Models where import Database.Groundhog (DefaultKey) import Database.Groundhog.TH import Data.Text data App = App { herokuId :: Text , region :: Text } deriving instance Eq App deriving instance Read App deriving instance Show App data Endpoint = Endpoint { endpointApp :: DefaultKey App , link :: Text } deriving instance Eq Endpoint deriving instance Read Endpoint deriving instance Show Endpoint data Event = Event { eventEndpoint :: DefaultKey Endpoint , eventApp :: DefaultKey App , ok :: Bool , reason :: Text } deriving instance Eq Event deriving instance Show Event deriving instance Read Event mkPersist defaultCodegenConfig [groundhog| - entity: App - entity: Endpoint - entity: Event |]