X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FTSN%2FXML%2FInjuries.hs;h=eb369e03eb8d1ecae646a383a4d0a95e9e2b8659;hb=7a5034bbe4feb8625b3a6c534f07427ecf848ad8;hp=6cc802f9752d2dcbc13d59e3415cd38f7d9fb963;hpb=1436c9e729921f989ef02ce81cbe9078d6f30476;p=dead%2Fhtsn-import.git diff --git a/src/TSN/XML/Injuries.hs b/src/TSN/XML/Injuries.hs index 6cc802f..eb369e0 100644 --- a/src/TSN/XML/Injuries.hs +++ b/src/TSN/XML/Injuries.hs @@ -82,7 +82,7 @@ data InjuriesTeam = -- * InjuriesListing/InjuriesListingXml --- | XML/Database representation of the injury listings. +-- | XML representation of the injury listings. -- data InjuriesListingXml = InjuriesListingXml { @@ -122,6 +122,9 @@ instance FromXmlFk InjuriesListingXml where db_injuries = xml_injuries, db_updated = xml_updated } +-- | This allows us to insert the XML representation +-- 'InjuriesListingXml' directly. +-- instance XmlImportFk InjuriesListingXml @@ -139,8 +142,7 @@ data Message = 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 { @@ -162,6 +164,9 @@ instance FromXml Message where db_sport = xml_sport, db_time_stamp = xml_time_stamp } +-- | This allows us to insert the XML representation 'Message' +-- directly. +-- instance XmlImport Message @@ -175,7 +180,8 @@ instance DbImport Message where 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