X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FTSN%2FXML%2FScores.hs;h=66ef90bee4ae31eb753094cefbb302e850d33afa;hb=b0a87f9323223a0af538184940b35a081f5763af;hp=571f6b383833da7c5edba1f146b25cb6fe7e15f0;hpb=fa27649ae583f6bdc20c54db4fc8f38a382a536c;p=dead%2Fhtsn-import.git diff --git a/src/TSN/XML/Scores.hs b/src/TSN/XML/Scores.hs index 571f6b3..66ef90b 100644 --- a/src/TSN/XML/Scores.hs +++ b/src/TSN/XML/Scores.hs @@ -67,6 +67,7 @@ import TSN.DbImport ( DbImport(..), ImportResult(..), run_dbmigrate ) import TSN.Picklers ( xp_time_stamp ) import TSN.XmlImport ( XmlImport(..), XmlImportFk(..) ) import Xml ( + Child(..), FromXml(..), FromXmlFk(..), ToDb(..), @@ -202,12 +203,15 @@ instance ToDb ScoreGameXml where -- type Db ScoreGameXml = ScoreGame -instance FromXmlFk ScoreGameXml where + +instance Child ScoreGameXml where -- | Each 'ScoreGameXml' is contained in (i.e. has a foreign key to) -- a 'Score'. -- type Parent ScoreGameXml = Score + +instance FromXmlFk ScoreGameXml where from_xml_fk fk ScoreGameXml{..} = ScoreGame { db_scores_id = fk, @@ -253,13 +257,15 @@ newtype ScoreGameHTeam = -- * ScoreGame_ScoreGameTeam -- | Join a 'ScoreGame' with its home/away teams. Database-only. We --- use a join table because the teams are kept unique. +-- use a join table because the teams are kept unique. The first +-- argument is the game id, the second argument is the visiting team +-- (vteam) id, and the last argument is the home team (hteam) id. -- data ScoreGame_ScoreGameTeam = ScoreGame_ScoreGameTeam - (DefaultKey ScoreGame) -- ^ game id - (DefaultKey ScoreGameTeam) -- ^ vteam id - (DefaultKey ScoreGameTeam) -- ^ hteam id + (DefaultKey ScoreGame) -- game id + (DefaultKey ScoreGameTeam) -- vteam id + (DefaultKey ScoreGameTeam) -- hteam id -- * ScoreLocation