forked from snowdriftcoop/snowdrift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModel.hs
41 lines (31 loc) · 1.23 KB
/
Model.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
module Model where
import Prelude
import Yesod
import Yesod.Auth.HashDB (HashDBUser (..))
import Data.Text (Text)
import Database.Persist.Quasi
import Data.Typeable (Typeable)
import Data.Time.Clock (UTCTime)
import Data.Int (Int64)
import Model.Currency (Milray)
import Model.Role.Internal (Role)
import Model.ClosureType.Internal (ClosureType)
import Model.Permission.Internal (PermissionLevel)
import Model.Markdown.Diff (MarkdownDiff)
import Model.ViewType.Internal (ViewType)
import Model.Settings.Internal (UserSettingName)
import Yesod.Markdown (Markdown)
import Control.Exception (Exception)
-- You can define all of your database entities in the entities file.
-- You can find more information on persistent and how to declare entities
-- at:
-- http://www.yesodweb.com/book/persistent/
share [mkPersist sqlOnlySettings, mkMigrate "migrateAll"]
$(persistFileWith lowerCaseSettings "config/models")
instance HashDBUser User where
userPasswordHash = userHash
userPasswordSalt = userSalt
setSaltAndPasswordHash salt hash user = user { userHash = Just hash, userSalt = Just salt }
data DBException = DBException deriving (Typeable, Show)
instance Exception DBException where