wwall3r / bingo

Example bingo app
2 stars 0 forks source link

compute score on completions trigger #24

Open wwall3r opened 1 year ago

wwall3r commented 1 year ago

This adds a scores table (card_id, score) and computes the score for a card on updates to completions. This is now used by the UI in the /games/[gameId]/ route.

Potential future improvements:

wwall3r commented 1 year ago

Hmm. Maybe it isn't running the score at all on the creation because the trigger is UPDATE rather than INSERT, so that is a non-issue.

wwall3r commented 1 year ago

I think this could use an updated_at on the scores table so that you could potentially sort by earliest or most recent for a given score as a tiebreaker.