-import Control.Monad.IO.Class ( MonadIO, liftIO )
-import Database.Groundhog (
- defaultMigrationLogger,
- insert,
- migrate,
- runMigration )
-import Database.Groundhog.Core ( PersistBackend, PersistEntity )
-import Network.Services.TSN.Report ( report_error )
-import Text.XML.HXT.Core (
- XmlPickler,
- XmlTree,
- unpickleDoc,
- xpickle )
-
--- | Instances of this type know how to insert themselves into a
--- Groundhog database.
+-- System imports
+import Control.Monad ( forM_ )
+import Control.Monad.IO.Class ( MonadIO( liftIO ) )
+import qualified Data.Map as Map ( elems )
+import Database.Groundhog ( executeRaw )
+import Database.Groundhog.Generic (
+ createMigration,
+ getQueries,
+ mergeMigrations )
+import Database.Groundhog.Core ( Migration, NamedMigrations, PersistBackend )
+import Network.Services.TSN.Report ( report_info )
+
+
+-- | The type that will be returned from every file import attempt.
+--
+data ImportResult =
+ ImportFailed String -- ^ Failure with an error message.
+
+ | ImportSkipped String -- ^ We processed the file, but didn't import it.
+ -- The reason is contained in the second field.
+
+ | ImportSucceeded -- ^ We did import records.
+
+ | ImportUnsupported String -- ^ We didn't know how to process this file.
+ -- The second field should contain info.
+
+
+-- | Instances of this type know how to run their own database
+-- migrations and insert themselves into a database.
+--