colodenn / beerpong-dashboard

:beer: Beer pong, also known as Beirut, is a drinking game in which players throw a ping pong ball across a table with the intent of landing the ball in a cup of beer on the other end.
https://beerpong.codenn.de/
9 stars 1 forks source link

Change Data Model #66

Open Karterano opened 2 years ago

Karterano commented 2 years ago

Store winner (or winner team) and loser (or loser team) and the score.
This removes the need for storing and querying the winner (or winner team) variable. In the frontend, this would remove computations for winners and remove string comparisons, only comaring the score to 0 is necessary for distinguishing draws. in the backend, this would reduce load on the database and also simplify views and thus reduce loading time, space and incrase the performance.

The creation interface could look the same, the endpoint for adding games can easily perform this transformation.