Overview:
In the previous iteration of BringMe, we used a jsonb column in the matches table to store the game state. This made subscribing to match updates easier (in Firebase, anyway). In this Supabase iteration, we will gain more from the benefits of using the relational database. To do this we will be adding a relationship between a Match and a new "Rounds" table.
AC:
Create the new Rounds table in Supabase
Rounds schema:
leader: Player (default NULL)
winner: Player (default NULL)
word: string (default NULL)
points: integer (default NULL)
time: integer (default 60)
time_remaining: integer (default NULL)
started_at: timestamp
finished_at: timestamp
status: enum (default NULL, can be one of [CREATED, STARTED, IN_PROGRESS, FINISHED])
Add the relationship between Matches/Rounds in Supabase (a Match can have many Rounds)
Use the supabase-cli to spit out a new schema and types definition
When a Match is created, create a predefined number of new Rounds (stored in a constant), and tie them together.
Overview: In the previous iteration of BringMe, we used a
jsonb
column in thematches
table to store the game state. This made subscribing to match updates easier (in Firebase, anyway). In this Supabase iteration, we will gain more from the benefits of using the relational database. To do this we will be adding a relationship between a Match and a new "Rounds" table.AC: