import Data.Data ( Data )
import Data.Typeable ( Typeable )
import Database.Groundhog (
- defaultMigrationLogger,
- migrate,
- runMigration )
+ migrate )
import Database.Groundhog.TH (
defaultCodegenConfig,
groundhog,
xpWrap )
-import TSN.DbImport ( DbImport(..), ImportResult(..) )
+import TSN.DbImport ( DbImport(..), ImportResult(..), run_dbmigrate )
import TSN.XmlImport ( XmlImport(..) )
import Xml ( FromXml(..), pickle_unpickle, unpickleable )
instance DbImport Message where
dbimport msg = mapM_ insert_xml (listings msg) >> return ImportSucceeded
- dbmigrate _ =
- runMigration defaultMigrationLogger $ migrate (undefined :: Listing)
+ dbmigrate _ = run_dbmigrate $ migrate (undefined :: Listing)
mkPersist defaultCodegenConfig [groundhog|
- entity: Listing
import Data.Time ( UTCTime )
import Data.Tuple.Curry ( uncurryN )
import Database.Groundhog (
- defaultMigrationLogger,
- migrate,
- runMigration )
+ migrate )
import Database.Groundhog.TH (
defaultCodegenConfig,
groundhog,
xpWrap )
import TSN.Picklers( xp_date, xp_team_id )
-import TSN.DbImport ( DbImport(..), ImportResult(..) )
+import TSN.DbImport ( DbImport(..), ImportResult(..), run_dbmigrate )
import TSN.XmlImport ( XmlImport(..) )
import Xml ( FromXml(..), pickle_unpickle, unpickleable )
mapM_ insert_xml (concatMap player_listings $ listings msg)
return ImportSucceeded
- dbmigrate _ =
- runMigration defaultMigrationLogger $ migrate (undefined :: PlayerListing)
+ dbmigrate _ = run_dbmigrate $ migrate (undefined :: PlayerListing)
mkPersist defaultCodegenConfig [groundhog|
- entity: PlayerListing
import Data.Tuple.Curry ( uncurryN )
import Data.Typeable ( Typeable )
import Database.Groundhog (
- defaultMigrationLogger,
insert_,
- migrate,
- runMigration )
+ migrate )
import Database.Groundhog.Core ( DefaultKey )
import Database.Groundhog.TH (
defaultCodegenConfig,
import TSN.Codegen (
tsn_codegen_config,
tsn_db_field_namer ) -- Used in a test
-import TSN.DbImport ( DbImport(..), ImportResult(..) )
+import TSN.DbImport ( DbImport(..), ImportResult(..), run_dbmigrate )
import TSN.XmlImport ( XmlImport(..) )
import Xml ( FromXml(..), pickle_unpickle, unpickleable )
instance DbImport Message where
dbmigrate _ =
- runMigration defaultMigrationLogger $ do
+ run_dbmigrate $ do
migrate (undefined :: NewsTeam)
migrate (undefined :: NewsLocation)
migrate (undefined :: News)