X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FTSN%2FXML%2FOdds.hs;h=63ecb3b8b62d8e2dcb52a82cc0253f38959dd3d6;hb=698ab20d3aae8ee6bbdd4b8ec01567f863393093;hp=52b7b9f025f5fc1981443523a777776467b954f5;hpb=a0853ebe00e630b7d50f97949d4dd45c602bd454;p=dead%2Fhtsn-import.git diff --git a/src/TSN/XML/Odds.hs b/src/TSN/XML/Odds.hs index 52b7b9f..63ecb3b 100644 --- a/src/TSN/XML/Odds.hs +++ b/src/TSN/XML/Odds.hs @@ -3,7 +3,6 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} @@ -33,7 +32,7 @@ import Database.Groundhog ( (=.), (==.), countAll, - executeRaw, + deleteAll, insert_, migrate, runMigration, @@ -67,7 +66,7 @@ import Text.XML.HXT.Core ( import TSN.Codegen ( tsn_codegen_config ) import TSN.DbImport ( DbImport(..), ImportResult(..), run_dbmigrate ) -import TSN.Picklers ( xp_date, xp_time, xp_time_stamp ) +import TSN.Picklers ( xp_date_padded, xp_time, xp_time_stamp ) import TSN.XmlImport ( XmlImport(..), XmlImportFk(..) ) import Xml ( FromXml(..), @@ -693,7 +692,7 @@ pickle_game = xpWrap (from_tuple, to_tuple) $ xp6Tuple (xpElem "GameID" xpInt) - (xpElem "Game_Date" xp_date) + (xpElem "Game_Date" xp_date_padded) (xpElem "Game_Time" xp_time) pickle_away_team pickle_home_team @@ -837,8 +836,7 @@ test_on_delete_cascade = testGroup "cascading delete tests" migrate e migrate f _ <- dbimport odds - -- No idea how 'delete' works, so do this instead. - executeRaw False "DELETE FROM odds;" [] + deleteAll a count_a <- countAll a count_b <- countAll b count_c <- countAll c