You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The teams, games, and players tables are keyed on ids that come from upstream. This is great for inserting future new records, as the INSERT OR IGNORE INTO logic accounts for duplicates already.
But for plays and shots, primary keys are generated and autoincremented, assuming that inserted records are always new records. This logic is faulty and sloppy at best, will corrupt the tables with duplicate data regularly at worst. We'll need to design a better procedure to handle these tables, perhaps only fetching records based on latest dateYearMonthDay for game_ids in the games table.
Come to think of it, I'm not sure how this will handle players that transfer schools, since the INSERT OR IGNORE statement will attempt to insert a new record, but may be rejected due to a duplicate primary key.
As of now, this issue isn't too outstanding because the 2014-2015 season doesn't begin for another 6 months, so work on the application and client side can commence as we now have a relational database. But this issue will need to be resolved if the application goes into production.
The text was updated successfully, but these errors were encountered:
The
teams
,games
, andplayers
tables are keyed on ids that come from upstream. This is great for inserting future new records, as theINSERT OR IGNORE INTO
logic accounts for duplicates already.But for
plays
andshots
, primary keys are generated and autoincremented, assuming that inserted records are always new records. This logic is faulty and sloppy at best, will corrupt the tables with duplicate data regularly at worst. We'll need to design a better procedure to handle these tables, perhaps only fetching records based on latestdateYearMonthDay
forgame_id
s in thegames
table.Come to think of it, I'm not sure how this will handle
players
that transfer schools, since theINSERT OR IGNORE
statement will attempt to insert a new record, but may be rejected due to a duplicate primary key.As of now, this issue isn't too outstanding because the 2014-2015 season doesn't begin for another 6 months, so work on the application and client side can commence as we now have a relational database. But this issue will need to be resolved if the application goes into production.
The text was updated successfully, but these errors were encountered: