from /omoikane/polis-like-systems-building. Polis-like system
Creating a muddy "foundation".
branding - Japanese cockchafer (Melolontha japonica).
pKomorebiKagami
Create project komorebi-kagami
Table Design
User authentication is handled by Firebase Auth, so there is no need to wait for RDB on your own.
The basic premise is that there are multiple yes-or-no questions within a single topic.
Don't we need to put the information about the question in the RDB as well?
The table for the voting contents will contain the ID of the topic, the ID of the voter, the ID of the question, and the voting contents which can be 1, 0, or -1, and the time of the vote.
This design allows each user to vote only once for each issue on each topic
Don't they need to be indexed or something?
The design can be made to overwrite the ballot when it already exists at the time of voting, or it can be designed to always add the new information and use only the latest information at the time of tallying, creating SQL for voting and SQL for tallying.
→One query in either case fits within the expressive power of SQL, but the former seems to make more sense.
Connect with Cloud Shell
Ha, it's done!
This page is auto-translated from /nishio/pKomorebiKagami2023-07-03 using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.