gcpreston / cuberacer_live

🧩 Twisty puzzle racing platform
https://cuberacer.io
0 stars 0 forks source link

Ecto.Enum for puzzle types and penalties #66

Closed gcpreston closed 2 years ago

gcpreston commented 2 years ago

These were previously represented as tables, however this caused some annoyance.

  1. To get the name of a penalty of puzzle type, you had to do an extra join or preload. Both of these should be readily available when fetching a session or solve.
  2. The tables only had :id and :name columns, meaning they could be represented as enumerated strings/atoms.