aboutsummaryrefslogtreecommitdiff
path: root/Database
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-09-25 09:57:41 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-09-25 09:57:41 -0400
commita3b98aa065308340590c63d69e988591efb006b3 (patch)
tree97a7460c91096d6797dc520173b2353bc29e6a3a /Database
parent5bb3a2c23f2d76a8d13894e217256cb3ed80e295 (diff)
fix build with old version of persistent
Diffstat (limited to 'Database')
-rw-r--r--Database/Export.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Database/Export.hs b/Database/Export.hs
index 17755d86b..a41048993 100644
--- a/Database/Export.hs
+++ b/Database/Export.hs
@@ -9,6 +9,7 @@
{-# LANGUAGE OverloadedStrings, GADTs, FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses, GeneralizedNewtypeDeriving #-}
{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE CPP #-}
module Database.Export (
ExportHandle,
@@ -122,9 +123,14 @@ getExportTreeCurrent (ExportHandle h _) = H.queryDbQueue h $ do
addExportedLocation :: ExportHandle -> Key -> ExportLocation -> IO ()
addExportedLocation h k el = queueDb h $ do
void $ insertUnique $ Exported ik ef
- insertMany_ $ map
+ let edirs = map
(\ed -> ExportedDirectory (toSFilePath (fromExportDirectory ed)) ef)
(exportDirectories el)
+#if MIN_VERSION_persistent(2,1,0)
+ insertMany_ edirs
+#else
+ void $ insertMany edirs
+#endif
where
ik = toIKey k
ef = toSFilePath (fromExportLocation el)