Refactored Sequelize models to use associations properly
Added migration to remove redundant keys and implement Sequelize association keys
From Scoresheet: All user info (including UserId), all flight info. Changed flight_key to FlightID, flight_total removed (dynamically calculated from Flight)
From Flight: Changed created_by to UserId
Refactored a TON of things to use UserId in Flight instead of scoresheet to avoid having a duplicate UserId
Tests:
Migrations and new schema tested with sqlite3 and Postgres locally
Ok boiz, buckle up - this one's a doozy
Changes:
Scoresheet
: All user info (including UserId), all flight info. Changedflight_key
toFlightID
,flight_total
removed (dynamically calculated from Flight)Flight
: Changedcreated_by
toUserId
UserId
in Flight instead of scoresheet to avoid having a duplicate UserIdTests: