about summary refs log tree commit diff
path: root/src/BlogDB.hs
diff options
context:
space:
mode:
authorVincent Ambo <vincent@spotify.com>2014-08-22T13·56+0200
committerVincent Ambo <vincent@spotify.com>2014-08-22T13·56+0200
commit56609f1f59d84d78dfd1a897ee3e9d04768d3bab (patch)
treeef678d4f87827c6d1819ed44ea4c901dd07d1bc5 /src/BlogDB.hs
parent2c0eecc9aa0496318a4ccf6205c32a41aa2b9970 (diff)
v4.2: Bump SafeCopy versions of types
Diffstat (limited to 'src/BlogDB.hs')
-rw-r--r--src/BlogDB.hs26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/BlogDB.hs b/src/BlogDB.hs
index b75d63447943..dd8aaaa66c30 100644
--- a/src/BlogDB.hs
+++ b/src/BlogDB.hs
@@ -26,7 +26,7 @@ import qualified Data.Text              as Text
 newtype EntryId = EntryId { unEntryId :: Integer }
     deriving (Eq, Ord, Data, Enum, Typeable)
 
-$(deriveSafeCopy 0 'base ''EntryId)
+$(deriveSafeCopy 2 'base ''EntryId)
 
 instance Show EntryId where
   show = show . unEntryId
@@ -47,11 +47,10 @@ data Entry = Entry {
     title    :: Text,
     btext    :: Text,
     mtext    :: Text,
-    edate    :: UTCTime,
-    tags     :: [Text]
+    edate    :: UTCTime
 } deriving (Eq, Ord, Show, Data, Typeable)
 
-$(deriveSafeCopy 0 'base ''Entry)
+$(deriveSafeCopy 2 'base ''Entry)
 
 -- ixSet requires different datatypes for field indexes, so let's define some
 newtype Author = Author Text   deriving (Eq, Ord, Data, Typeable)
@@ -64,15 +63,15 @@ newtype SDate  = SDate UTCTime   deriving (Eq, Ord, Data, Typeable)
 newtype Username = Username Text deriving (Eq, Ord, Data, Typeable)
 newtype SessionID = SessionID Text deriving (Eq, Ord, Data, Typeable)
 
-$(deriveSafeCopy 0 'base ''Author)
-$(deriveSafeCopy 0 'base ''Title)
-$(deriveSafeCopy 0 'base ''BText)
-$(deriveSafeCopy 0 'base ''MText)
-$(deriveSafeCopy 0 'base ''Tag)
-$(deriveSafeCopy 0 'base ''EDate)
-$(deriveSafeCopy 0 'base ''SDate)
-$(deriveSafeCopy 0 'base ''Username)
-$(deriveSafeCopy 0 'base ''SessionID)
+$(deriveSafeCopy 2 'base ''Author)
+$(deriveSafeCopy 2 'base ''Title)
+$(deriveSafeCopy 2 'base ''BText)
+$(deriveSafeCopy 2 'base ''MText)
+$(deriveSafeCopy 2 'base ''Tag)
+$(deriveSafeCopy 2 'base ''EDate)
+$(deriveSafeCopy 2 'base ''SDate)
+$(deriveSafeCopy 2 'base ''Username)
+$(deriveSafeCopy 2 'base ''SessionID)
 
 instance Indexable Entry where
     empty = ixSet [ ixFun $ \e -> [ entryId e]
@@ -82,7 +81,6 @@ instance Indexable Entry where
                   , ixFun $ \e -> [ BText $ btext e]
                   , ixFun $ \e -> [ MText $ mtext e]
                   , ixFun $ \e -> [ EDate $ edate e]
-                  , ixFun $ \e -> map Tag (tags e)
                   ]
 
 data User = User {