]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blobdiff - src/TSN/XML/AutoRacingSchedule.hs
Insignificant comment fix.
[dead/htsn-import.git] / src / TSN / XML / AutoRacingSchedule.hs
index ab1c29ef01db05be044eabb0055eb91635558039..212eee98a545f5cd106a64c900a136324727d570 100644 (file)
@@ -3,7 +3,6 @@
 {-# LANGUAGE GADTs #-}
 {-# LANGUAGE QuasiQuotes #-}
 {-# LANGUAGE RecordWildCards #-}
-{-# LANGUAGE StandaloneDeriving #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeFamilies #-}
 
@@ -29,7 +28,7 @@ import Data.Time ( UTCTime(..) )
 import Data.Tuple.Curry ( uncurryN )
 import Database.Groundhog (
   countAll,
-  executeRaw,
+  deleteAll,
   migrate,
   runMigration,
   silentMigrationLogger )
@@ -57,7 +56,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_tba_time, xp_time_stamp )
+import TSN.Picklers ( xp_date_padded, xp_tba_time, xp_time_stamp )
 import TSN.XmlImport ( XmlImport(..), XmlImportFk(..) )
 import Xml (
   FromXml(..),
@@ -141,7 +140,7 @@ instance XmlImport Message
 -- * AutoRacingScheduleListing/AutoRacingScheduleListingXml
 
 -- | Database representation of a \<Listing\> contained within a
---   \<Message\>. We combine the race date/time into a single
+--   \<message\>. We combine the race date/time into a single
 --   race_time, drop the race results list, and add a foreign key to
 --   our parent.
 --
@@ -245,8 +244,7 @@ newtype AutoRacingScheduleListingRaceResult =
   deriving (Eq, Show)
 
 
--- * AutoRacingScheduleListingRaceResultRaceResultListing /
---   AutoRacingScheduleListingRaceResultRaceResultListingXml
+-- * AutoRacingScheduleListingRaceResultRaceResultListing / AutoRacingScheduleListingRaceResultRaceResultListingXml
 --
 --   Sorry about the names yo.
 --
@@ -420,7 +418,7 @@ pickle_listing =
   xpElem "Listing" $
     xpWrap (from_tuple, to_tuple) $
       xp10Tuple (xpElem "RaceID" xpInt)
-                (xpElem "Race_Date" xp_date)
+                (xpElem "Race_Date" xp_date_padded)
                 (xpElem "Race_Time" xp_tba_time)
                 (xpElem "RaceName" xpText)
                 (xpElem "TrackName" xpText)
@@ -555,8 +553,7 @@ test_on_delete_cascade = testGroup "cascading delete tests"
                     migrate b
                     migrate c
                   _ <- dbimport sched
-                  -- No idea how 'delete' works, so do this instead.
-                  executeRaw False "DELETE FROM auto_racing_schedules;" []
+                  deleteAll a
                   count_a <- countAll a
                   count_b <- countAll b
                   count_c <- countAll c