Datenbankschema abfragen

Was ist das beste Datenbankschema für Umfragen? Ist eine Eins-zu-Viele-Beziehung dafür gut? Ich denke über zwei Tische nach:

poll_questions
    int id
    varchar body
    datetime created_at
    datetime updated_at

poll_answers
    int id
    varchar body
    int votes default 0
    int question_id (foreign key to poll_questions.id)
    datetime created_at
    datetime updated_at

Dann gibt es auch eine dritte Tabelle zum Verfolgen, wer für eine Antwort gestimmt hat, sodass Benutzer nur einmal abstimmen können:

poll_voting_history
    int id
    int question_id (foreign key to poll_questions.id)
    int answer_id (foreign key to poll_answers.id)
    int user_id (foreign key to the id in the users table)
    datetime created_at
    datetime updated_at

Was sind deine Gedanken? Denke ich darüber nach, richtig?

Antworten auf die Frage(3)

Ihre Antwort auf die Frage