From: Michael Orlitzky Date: Fri, 4 Jul 2014 19:42:25 +0000 (-0400) Subject: Change the AutoRacingResults track length to a String (yeah). X-Git-Tag: 0.0.6~36 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=a598aadfa97ff2d4d287c0bc36f579198d21dfa1;p=dead%2Fhtsn-import.git Change the AutoRacingResults track length to a String (yeah). Update the AutoRacingResults dbschema diagram. --- diff --git a/doc/dbschema/AutoRacingResultsXML.png b/doc/dbschema/AutoRacingResultsXML.png index 5365fe2..6048429 100644 Binary files a/doc/dbschema/AutoRacingResultsXML.png and b/doc/dbschema/AutoRacingResultsXML.png differ diff --git a/src/TSN/XML/AutoRacingResults.hs b/src/TSN/XML/AutoRacingResults.hs index 370ae81..a32d704 100644 --- a/src/TSN/XML/AutoRacingResults.hs +++ b/src/TSN/XML/AutoRacingResults.hs @@ -272,7 +272,8 @@ data AutoRacingResultsRaceInformation = -- Note the apostrophe to disambiguate it from the -- AutoRacingResultsListing field. db_auto_racing_results_id' :: DefaultKey AutoRacingResults, - db_track_length :: Double, + db_track_length :: String, -- ^ Usually a Double, but sometimes a String, + -- like \"1.25 miles\". db_track_length_kph :: Double, db_laps :: Int, db_average_speed_mph :: Maybe Double, @@ -291,7 +292,7 @@ data AutoRacingResultsRaceInformation = -- data AutoRacingResultsRaceInformationXml = AutoRacingResultsRaceInformationXml { - xml_track_length :: Double, + xml_track_length :: String, xml_track_length_kph :: Double, xml_laps :: Int, xml_average_speed_mph :: Maybe Double, @@ -529,7 +530,7 @@ pickle_race_information = xp11Tuple (-- I can't think of another way to get both the -- TrackLength and its KPH attribute. So we shove them -- both in a 2-tuple. This should probably be an embedded type! - xpElem "TrackLength" $ xpPair xpPrim (xpAttr "KPH" xpPrim) ) + xpElem "TrackLength" $ xpPair xpText (xpAttr "KPH" xpPrim) ) (xpElem "Laps" xpInt) (xpOption $ xpElem "AverageSpeedMPH" xpPrim) (xpOption $ xpElem "AverageSpeedKPH" xpPrim)