fix build with old version of persistent
This commit is contained in:
parent
83d063c63b
commit
710d6a35ed
1 changed files with 7 additions and 1 deletions
|
@ -9,6 +9,7 @@
|
||||||
{-# LANGUAGE OverloadedStrings, GADTs, FlexibleContexts #-}
|
{-# LANGUAGE OverloadedStrings, GADTs, FlexibleContexts #-}
|
||||||
{-# LANGUAGE MultiParamTypeClasses, GeneralizedNewtypeDeriving #-}
|
{-# LANGUAGE MultiParamTypeClasses, GeneralizedNewtypeDeriving #-}
|
||||||
{-# LANGUAGE RankNTypes #-}
|
{-# LANGUAGE RankNTypes #-}
|
||||||
|
{-# LANGUAGE CPP #-}
|
||||||
|
|
||||||
module Database.Export (
|
module Database.Export (
|
||||||
ExportHandle,
|
ExportHandle,
|
||||||
|
@ -122,9 +123,14 @@ getExportTreeCurrent (ExportHandle h _) = H.queryDbQueue h $ do
|
||||||
addExportedLocation :: ExportHandle -> Key -> ExportLocation -> IO ()
|
addExportedLocation :: ExportHandle -> Key -> ExportLocation -> IO ()
|
||||||
addExportedLocation h k el = queueDb h $ do
|
addExportedLocation h k el = queueDb h $ do
|
||||||
void $ insertUnique $ Exported ik ef
|
void $ insertUnique $ Exported ik ef
|
||||||
insertMany_ $ map
|
let edirs = map
|
||||||
(\ed -> ExportedDirectory (toSFilePath (fromExportDirectory ed)) ef)
|
(\ed -> ExportedDirectory (toSFilePath (fromExportDirectory ed)) ef)
|
||||||
(exportDirectories el)
|
(exportDirectories el)
|
||||||
|
#if MIN_VERSION_persistent(2,1,0)
|
||||||
|
insertMany_ edirs
|
||||||
|
#else
|
||||||
|
void $ insertMany edirs
|
||||||
|
#endif
|
||||||
where
|
where
|
||||||
ik = toIKey k
|
ik = toIKey k
|
||||||
ef = toSFilePath (fromExportLocation el)
|
ef = toSFilePath (fromExportLocation el)
|
||||||
|
|
Loading…
Reference in a new issue