X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FTSN%2FXML%2FNews.hs;h=913477168540ea47e178adca60e0d1b21bd2165e;hb=b4b15dad064fdd910a4ad8f36b6969ce909e05b2;hp=49be37e932ea3d7414cdb1ab6b9b1d0263243a5d;hpb=a0853ebe00e630b7d50f97949d4dd45c602bd454;p=dead%2Fhtsn-import.git diff --git a/src/TSN/XML/News.hs b/src/TSN/XML/News.hs index 49be37e..9134771 100644 --- a/src/TSN/XML/News.hs +++ b/src/TSN/XML/News.hs @@ -3,7 +3,6 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} @@ -31,7 +30,7 @@ import Data.Tuple.Curry ( uncurryN ) import Data.Typeable ( Typeable ) import Database.Groundhog ( countAll, - executeRaw, + deleteAll, insert_, migrate, runMigration, @@ -86,9 +85,9 @@ dtd = "newsxml.dtd" -- * News/Message --- | The msg_id child of contains an event_id attribute; we --- embed it into the 'News' type. We (pointlessly) use the "db_" --- prefix here so that the two names don't collide on "id" when +-- | The msg_id child of \ contains an event_id attribute; we +-- embed it into the 'News' type. We (pointlessly) use the \"db_\" +-- prefix here so that the two names don't collide on \"id\" when -- Groundhog is creating its fields using our field namer. -- data MsgId = @@ -530,8 +529,7 @@ test_on_delete_cascade = testGroup "cascading delete tests" migrate d migrate e _ <- dbimport news - -- No idea how 'delete' works, so do this instead. - executeRaw False "DELETE FROM news;" [] + deleteAll a count_a <- countAll a count_b <- countAll b count_c <- countAll c