]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blobdiff - src/TSN/XML/AutoRacingSchedule.hs
Replace all raw DELETE queries with deleteAll.
[dead/htsn-import.git] / src / TSN / XML / AutoRacingSchedule.hs
index 27b73ef44fc49a9630719844bba17e8e783aace0..aeb8745a505029991fa314acbbb34a833e11c204 100644 (file)
@@ -13,6 +13,7 @@
 --   containing \<RaceResultsListing\>s.
 --
 module TSN.XML.AutoRacingSchedule (
+  dtd,
   pickle_message,
   -- * Tests
   auto_racing_schedule_tests,
@@ -28,7 +29,7 @@ import Data.Time ( UTCTime(..) )
 import Data.Tuple.Curry ( uncurryN )
 import Database.Groundhog (
   countAll,
-  executeRaw,
+  deleteAll,
   migrate,
   runMigration,
   silentMigrationLogger )
@@ -67,6 +68,11 @@ import Xml (
   unsafe_unpickle )
 
 
+-- | The DTD to which this module corresponds. Used to invoke dbimport.
+--
+dtd :: String
+dtd = "Auto_Racing_Schedule_XML.dtd"
+
 --
 -- DB/XML data types
 --
@@ -549,8 +555,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