From: Michael Orlitzky Date: Sat, 5 Jul 2014 14:51:24 +0000 (-0400) Subject: Make the Odds team rotation numbers optional. X-Git-Tag: 0.0.6~33 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=09fb9f7ddc30d003224da3fc45142ce2e37c4cbf;p=dead%2Fhtsn-import.git Make the Odds team rotation numbers optional. Update the Odds dbschema diagram. --- diff --git a/doc/dbschema/Odds_XML.png b/doc/dbschema/Odds_XML.png index 63f822c..934d275 100644 Binary files a/doc/dbschema/Odds_XML.png and b/doc/dbschema/Odds_XML.png differ diff --git a/src/TSN/XML/Odds.hs b/src/TSN/XML/Odds.hs index 4ca6475..934c3d3 100644 --- a/src/TSN/XML/Odds.hs +++ b/src/TSN/XML/Odds.hs @@ -166,7 +166,7 @@ data OddsGameHomeTeamXml = -- so we ignore the probable -- upper bound of three -- characters. - xml_home_team_rotation_number :: Int, + xml_home_team_rotation_number :: Maybe Int, xml_home_team_abbr :: String, xml_home_team_name :: String, xml_home_team_starter :: Maybe (Int, String), -- ^ (id, name) @@ -209,7 +209,7 @@ data OddsGameAwayTeamXml = -- on lengthless text fields, so -- we ignore the probable upper -- bound of three characters - xml_away_team_rotation_number :: Int, + xml_away_team_rotation_number :: Maybe Int, xml_away_team_abbr :: String, xml_away_team_name :: String, xml_away_team_starter :: Maybe (Int, String), -- ^ (id, name) @@ -284,8 +284,8 @@ data OddsGame = db_home_team_id :: DefaultKey Team, db_game_id :: Int, db_game_time :: UTCTime, -- ^ Contains both the date and time. - db_away_team_rotation_number :: Int, - db_home_team_rotation_number :: Int, + db_away_team_rotation_number :: Maybe Int, + db_home_team_rotation_number :: Maybe Int, db_away_team_starter_id :: Maybe Int, db_away_team_starter_name :: Maybe String, db_home_team_starter_id :: Maybe Int, @@ -619,7 +619,7 @@ pickle_home_team = xpWrap (from_tuple, to_tuple) $ xp6Tuple (xpElem "HomeTeamID" xpText) - (xpElem "HomeRotationNumber" xpInt) + (xpElem "HomeRotationNumber" (xpOption xpInt)) (xpElem "HomeAbbr" xpText) (xpElem "HomeTeamName" xpText) (-- This is an ugly way to get both the HStarter ID attribute @@ -645,7 +645,7 @@ pickle_away_team = xpWrap (from_tuple, to_tuple) $ xp6Tuple (xpElem "AwayTeamID" xpText) - (xpElem "AwayRotationNumber" xpInt) + (xpElem "AwayRotationNumber" (xpOption xpInt)) (xpElem "AwayAbbr" xpText) (xpElem "AwayTeamName" xpText) (-- This is an ugly way to get both the AStarter ID attribute