]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blobdiff - src/TSN/XML/Weather.hs
Replace all raw DELETE queries with deleteAll.
[dead/htsn-import.git] / src / TSN / XML / Weather.hs
index 2561377afebd77f7af1911e2ab47b0e0dc6de732..bda29ee2541005efb4ca1eaedcccf77d1231d201 100644 (file)
@@ -10,6 +10,7 @@
 --   that league contains a bunch of listings.
 --
 module TSN.XML.Weather (
+  dtd,
   pickle_message,
   -- * Tests
   weather_tests,
@@ -25,7 +26,7 @@ import Data.Time ( UTCTime )
 import Data.Tuple.Curry ( uncurryN )
 import Database.Groundhog (
   countAll,
-  executeRaw,
+  deleteAll,
   migrate,
   runMigration,
   silentMigrationLogger )
@@ -64,6 +65,13 @@ import Xml (
   unsafe_unpickle )
 
 
+
+-- | The DTD to which this module corresponds. Used to invoke dbimport.
+--
+dtd :: String
+dtd = "weatherxml.dtd"
+
+
 --
 -- DB/XML Data types
 --
@@ -404,8 +412,7 @@ test_on_delete_cascade =
                   migrate b
                   migrate c
                 _ <- dbimport weather
-                -- No idea how 'delete' works, so do this instead.
-                executeRaw False "DELETE FROM weather;" []
+                deleteAll a
                 count_a <- countAll a
                 count_b <- countAll b
                 count_c <- countAll c