insert_xml_fk_ msg_id (xml_race_information m)
- forM_ (xml_listings m) $ \listing -> do
- insert_xml_fk_ msg_id listing
+ forM_ (xml_listings m) $ insert_xml_fk_ msg_id
return ImportSucceeded
reference:
onDelete: cascade
-# Note the apostrophe in the foreign key. This is to disambiguate
-# it from the AutoRacingResultsListing foreign key of the same name.
-# We strip it out of the dbName.
+ # Note the apostrophe in the foreign key. This is to disambiguate
+ # it from the AutoRacingResultsListing foreign key of the same name.
+ # We strip it out of the dbName.
- entity: AutoRacingResultsRaceInformation
dbName: auto_racing_results_race_information
constructors:
xmltrees <- mapM unsafe_read_document game_info_test_files
let msgs = rights $ map (parse_xml "dummy") xmltrees
actual <- withSqliteConn ":memory:" $ runDbConn $ do
- runMigration silentMigrationLogger $ do
+ runMigration silentMigrationLogger $
migrate (undefined :: GameInfo)
mapM_ dbimport msgs
countAll (undefined :: GameInfo)
- name: db_status
dbName: status
-# Many of the JFileGameOddsInfo fields are redundant and have
-# been left out.
+ # Many of the JFileGameOddsInfo fields are redundant and have
+ # been left out.
- embedded: JFileGameOddsInfo
fields:
- name: db_list_date
where
-- System imports.
+import Control.Applicative ( (<$>) )
import Control.Monad ( forM_, join )
import Data.Time ( UTCTime(..) )
import Data.Tuple.Curry ( uncurryN )
(xml_team_rotation_number xml_home_team),
db_away_team_starter_id =
- (fmap fst $ xml_team_starter xml_away_team),
+ (fst <$> xml_team_starter xml_away_team),
db_away_team_starter_name =
- (fmap snd $ xml_team_starter xml_away_team),
+ (snd <$> xml_team_starter xml_away_team),
db_home_team_starter_id =
- (fmap fst $ xml_team_starter xml_home_team),
+ (fst <$> xml_team_starter xml_home_team),
db_home_team_starter_name =
- (fmap snd $ xml_team_starter xml_home_team) }
+ (snd <$> xml_team_starter xml_home_team) }
-- | This lets us insert the XML representation 'OddsGameXml' directly.
# Prevent multiple imports of the same message.
fields: [db_xml_file_id]
-# Note: we drop the "sc" prefix from the db_sc_sport field.
+ # Note: we drop the "sc" prefix from the db_sc_sport field.
- entity: ScheduleChangesListing
dbName: schedule_changes_listings
constructors:
db_home_team_id = fk_home,
db_away_team_score = xml_away_team_score,
db_home_team_score = xml_home_team_score,
- db_away_team_pitcher = (xml_vpitcher $ xml_vteam),
- db_home_team_pitcher = (xml_hpitcher $ xml_hteam),
+ db_away_team_pitcher = xml_vpitcher xml_vteam,
+ db_home_team_pitcher = xml_hpitcher xml_hteam,
db_time_r = xml_time_r,
db_status = xml_status,
db_notes = xml_notes }
xmltrees <- mapM unsafe_read_document sport_info_test_files
let msgs = rights $ map (parse_xml "dummy") xmltrees
actual <- withSqliteConn ":memory:" $ runDbConn $ do
- runMigration silentMigrationLogger $ do
+ runMigration silentMigrationLogger $
migrate (undefined :: SportInfo)
mapM_ dbimport msgs
countAll (undefined :: SportInfo)
reference:
onDelete: cascade
-# We rename the two fields that needed a "dtl" prefix to avoid a name clash.
+ # We rename the two fields that needed a "dtl" prefix to avoid a name
+ # clash.
- entity: WeatherDetailedWeatherListingItem
dbName: weather_detailed_items
constructors:
--
test_types_detected_correctly :: TestTree
test_types_detected_correctly =
- testGroup "weatherxml types detected correctly" $
+ testGroup "weatherxml types detected correctly"
[ check "test/xml/weatherxml.xml"
"first type detected correctly"
True,