r-anime/awards-web

Rework categories table

Closed this issue · 1 comments

Categories currently store all their entries as a JSON strange in an entries column. This works pretty badly because you have race conditions if two hosts are working on a category at the same time. Additionally, the JSON strings were a huge part of the headache in public voting since Entry components need the data stored in those JSON strings to function. A good way to solve this issue is to have a separate entries table with foreign keys and anilist IDs. id_in works pretty well and we need to somehow initialize objects solely from IDs and make our logic smoother. Similarly, subtitles for categories to explain what they're about is also a good idea.

Fixed in #100 but category subtitles are not yet implemented. They can be added via a migration when we need them.