什么是最佳的轮询数据库模式?一对多关系对此有好处吗?我在想两张桌子:
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
那么还有第三个表可以跟踪谁投票答案,所以用户只能投票一次:
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
你怎么看?我在想吗?