import Data.Typeable ( Typeable )
import Database.Groundhog (
countAll,
- executeRaw,
+ deleteAll,
insert,
insert_,
migrate,
-- * 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
migrate f
_ <- dbimport score
-- No idea how 'delete' works, so do this instead.
- executeRaw False "DELETE FROM scores;" []
+ deleteAll a
count_a <- countAll a
count_b <- countAll b
count_c <- countAll c