-- * InjuriesListing/InjuriesListingXml
--- | XML/Database representation of the injury listings.
+-- | XML representation of the injury listings.
--
data InjuriesListingXml =
InjuriesListingXml {
db_injuries = xml_injuries,
db_updated = xml_updated }
+-- | This allows us to insert the XML representation
+-- 'InjuriesListingXml' directly.
+--
instance XmlImportFk InjuriesListingXml
xml_time_stamp :: UTCTime }
deriving (Eq, Show)
--- | Database representation of a 'Message'. We really only care about
--- the time stamp.
+-- | Database representation of a 'Message'.
--
data Injuries =
Injuries {
db_sport = xml_sport,
db_time_stamp = xml_time_stamp }
+-- | This allows us to insert the XML representation 'Message'
+-- directly.
+--
instance XmlImport Message
migrate (undefined :: Injuries)
migrate (undefined :: InjuriesListing)
- -- | We import a 'Message' by inserting all of its 'listings'.
+ -- | We import a 'Message' by inserting all of its 'listings', but
+ -- the listings require a foreign key to the parent 'Message'.
--
dbimport msg = do
msg_id <- insert_xml msg