+-- Local imports.
+import TSN.Codegen ( tsn_codegen_config )
+import TSN.DbImport ( DbImport(..), ImportResult(..), run_dbmigrate )
+import TSN.Picklers ( xp_time_stamp )
+import TSN.XmlImport ( XmlImport(..), XmlImportFk(..) )
+import Xml (
+ Child(..),
+ FromXml(..),
+ FromXmlFk(..),
+ ToDb(..),
+ pickle_unpickle,
+ unpickleable,
+ unsafe_unpickle )
+
+
+
+-- | The DTD to which this module corresponds. Used to invoke dbimport.
+--
+dtd :: String
+dtd = "injuriesxml.dtd"
+
+--
+-- DB/XML Data types
+--
+
+-- * InjuriesTeam
+
+-- | XML/Database representation of a team as they appear in the
+-- injuries documents.
+--
+data InjuriesTeam =
+ InjuriesTeam {
+ db_team_name :: String,
+ db_team_league :: Maybe String }
+ deriving (Data, Eq, Show, Typeable)
+
+
+-- * InjuriesListing/InjuriesListingXml
+
+-- | XML representation of the injury listings. The leading
+-- underscores prevent unused field warnings.
+--
+data InjuriesListingXml =
+ InjuriesListingXml {
+ _xml_team :: InjuriesTeam,
+ _xml_teamno :: Maybe String, -- ^ Can contain non-numerics, e.g. \"ZR2\"
+ _xml_injuries :: String,
+ _xml_updated :: Maybe Bool }
+ deriving (Eq, GHC.Generic, Show)
+
+
+-- | For 'H.convert'.
+--
+instance H.HVector InjuriesListingXml
+
+
+-- | Database representation of a 'InjuriesListing'. It possesses a
+-- foreign key to an 'Injuries' object so that we can easily delete
+-- 'InjuriesListing's based on the parent message's time_stamp.
+-- The leading underscores prevent unused field warnings.
+--
+data InjuriesListing =
+ InjuriesListing {
+ _db_injuries_id :: DefaultKey Injuries,
+ _db_team :: InjuriesTeam,
+ _db_teamno :: Maybe String, -- ^ Can contain non-numerics, e.g. \"ZR2\"
+ _db_injuries :: String,
+ _db_updated :: Maybe Bool }
+ deriving ( GHC.Generic )
+
+-- | For 'H.cons'.
+--
+instance H.HVector InjuriesListing
+
+instance ToDb InjuriesListingXml where
+ -- | The DB analogue of a 'InjuriesListingXml' is a 'InjuriesListing'
+ type Db InjuriesListingXml = InjuriesListing
+
+instance Child InjuriesListingXml where
+ -- | Our foreign key points to an 'Injuries'.
+ type Parent InjuriesListingXml = Injuries