]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blobdiff - src/TSN/XML/Injuries.hs
Add SportInfo support for NBAScorersXML.dtd.
[dead/htsn-import.git] / src / TSN / XML / Injuries.hs
index 81243e44f20f8edd0dbd0f77a46c992379b2132f..1d1d3149638e72abce975d50983fb195a8028aff 100644 (file)
@@ -3,7 +3,6 @@
 {-# LANGUAGE GADTs #-}
 {-# LANGUAGE QuasiQuotes #-}
 {-# LANGUAGE RecordWildCards #-}
-{-# LANGUAGE StandaloneDeriving #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeFamilies #-}
 
@@ -17,6 +16,7 @@
 --   time_stamp.
 --
 module TSN.XML.Injuries (
+  dtd,
   pickle_message,
   -- * Tests
   injuries_tests,
@@ -31,7 +31,7 @@ import Data.Time ( UTCTime )
 import Data.Typeable ( Typeable )
 import Database.Groundhog (
   countAll,
-  executeRaw,
+  deleteAll,
   migrate,
   runMigration,
   silentMigrationLogger )
@@ -72,6 +72,12 @@ import Xml (
   unsafe_unpickle )
 
 
+
+-- | The DTD to which this module corresponds. Used to invoke dbimport.
+--
+dtd :: String
+dtd = "injuriesxml.dtd"
+
 --
 -- DB/XML Data types
 --
@@ -339,8 +345,7 @@ test_on_delete_cascade =
                   migrate a
                   migrate b
                 _ <- dbimport inj
-                -- No idea how 'delete' works, so do this instead.
-                executeRaw False "DELETE FROM injuries;" []
+                deleteAll a
                 count_a <- countAll a
                 count_b <- countAll b
                 return $ count_a + count_b