import Database.Groundhog (
countAll,
insert_,
- migrate,
- runMigration,
- silentMigrationLogger )
-import Database.Groundhog.Generic ( runDbConn )
+ migrate )
+import Database.Groundhog.Generic ( runDbConn, runMigrationSilent )
import Database.Groundhog.Sqlite ( withSqliteConn )
import Database.Groundhog.TH (
defaultCodegenConfig,
-- They provide foreign keys into any tables storing
-- games with their IDs.
- schedule_id :: Int, -- ^ Required foreign key into any table storing a
- -- schedule along with its ID.
+ schedule_id :: Maybe Int, -- ^ Optional key into any table storing a
+ -- schedule along with its ID. We've noticed
+ -- them missing in e.g. recapxml.dtd documents.
time_stamp :: UTCTime,
xml :: String }
deriving (Eq, Show)
let a4 = game_id t
let ex4 = Just 39978
let a5 = schedule_id t
- let ex5 = 39978
+ let ex5 = Just 39978
let a6 = take 9 (xml t)
let ex6 = "<message>"
let actual = (a1,a2,a3,a4,a5,a6)
xmltrees <- mapM unsafe_read_document game_info_test_files
let msgs = rights $ map (parse_xml "dummy") xmltrees
actual <- withSqliteConn ":memory:" $ runDbConn $ do
- runMigration silentMigrationLogger $
+ runMigrationSilent $
migrate (undefined :: GameInfo)
mapM_ dbimport msgs
countAll (undefined :: GameInfo)