I'm working on a fantasy racing team project. I'm having trouble laying out the schema when it comes to the
team table and the trades. I think I have the
result tables laid out okay:
Each team has to have 10 drivers; two in group one, three in group two, and five in group three.
Each team may have two trades throughout the season. The traded and obtained columns are there so I can calculate who is on a team at a specific race (or point in time). For example, if there were three races and
driver_1_1 was traded away after the first race, the team would only get that driver's points for the first race. For the last two races they would get points from the driver that
driver_1_1 was traded for.
I have a strong feeling that the
team table can be done in a much better way, but I'm having trouble wrapping my head around it, especially because of the trades. Please help me normalize!
If it matters I'm planning on using the latest Django Python and PostgreSQL.
Here's a simplified version of the schema without all of the fluff. I've also gotten rid of the hard coded driver columns and replaced them with a
pick table. There's still the matter of the trades, and whether or not this is the right way to go about something something like this. Better?