aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/src/Thermoprint/Server/Database.hs9
-rw-r--r--server/src/Thermoprint/Server/Database/Instances.hs2
2 files changed, 8 insertions, 3 deletions
diff --git a/server/src/Thermoprint/Server/Database.hs b/server/src/Thermoprint/Server/Database.hs
index 65bfc37..29732e1 100644
--- a/server/src/Thermoprint/Server/Database.hs
+++ b/server/src/Thermoprint/Server/Database.hs
@@ -4,6 +4,7 @@
4{-# LANGUAGE TypeFamilies #-} 4{-# LANGUAGE TypeFamilies #-}
5{-# LANGUAGE ExistentialQuantification #-} 5{-# LANGUAGE ExistentialQuantification #-}
6{-# LANGUAGE GeneralizedNewtypeDeriving #-} 6{-# LANGUAGE GeneralizedNewtypeDeriving #-}
7{-# LANGUAGE FlexibleInstances #-}
7 8
8module Thermoprint.Server.Database 9module Thermoprint.Server.Database
9 ( Job(..), JobId 10 ( Job(..), JobId
@@ -11,17 +12,23 @@ module Thermoprint.Server.Database
11 , migrateAll 12 , migrateAll
12 ) where 13 ) where
13 14
15import Control.DeepSeq
16
14import Thermoprint.API (Printout, DraftTitle, JobStatus) 17import Thermoprint.API (Printout, DraftTitle, JobStatus)
15 18
16import Database.Persist.TH 19import Database.Persist.TH
20import Database.Persist.Sql (unSqlBackendKey)
21import Database.Persist.Class (Key)
17 22
18import Thermoprint.Server.Database.Instances 23import Thermoprint.Server.Database.Instances
19 24
20share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase| 25share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase|
21Job 26Job
22 content Printout 27 content Printout
23 status JobStatus
24Draft 28Draft
25 title DraftTitle Maybe 29 title DraftTitle Maybe
26 content Printout 30 content Printout
27|] 31|]
32
33instance NFData (Key Job) where
34 rnf = rnf . unSqlBackendKey . unJobKey
diff --git a/server/src/Thermoprint/Server/Database/Instances.hs b/server/src/Thermoprint/Server/Database/Instances.hs
index e54f90e..888e7a0 100644
--- a/server/src/Thermoprint/Server/Database/Instances.hs
+++ b/server/src/Thermoprint/Server/Database/Instances.hs
@@ -9,5 +9,3 @@ import Thermoprint.API (Printout, JobStatus, PrintingError)
9import Database.Persist.TH 9import Database.Persist.TH
10 10
11derivePersistFieldJSON "Printout" 11derivePersistFieldJSON "Printout"
12derivePersistField "PrintingError"
13derivePersistField "JobStatus"