As my first project, I'm attempting to recreate a sports league database I've built for my own use directly in MySQL - it's kind of a data warehouse thing so I think of it as good practice because there's no user logins and levels to work with just yet.
I have a question regarding one of my models versus how I do it in sequel.
has_many :teams through :gameteam
has_many :games through :gameteam
this model indicates which two teams (by id) played in the game (by id) and whether that team was home or away and winner/loser
this model will store all the end of game stats (by team) for each game...i.e there are two lines per game_id - one for the home and one for the away team
My question is should i create a 'complex' foreign key of GameID and TeamID or should i have it reference the auto generated id in the 'gameteam' model.
I'm not used to using auto generated keys - in general Relational database design you often wanna use a 'memorable' primary key because you're writing direct queries but I was thinking that because of the rails 'top' i could use the GameTeam_id and it might save time?
I hope this questions makes sense