开发者

Store list of users who have voted and stop re-voting

开发者 https://www.devze.com 2023-02-03 23:26 出处:网络
I want to store the list of users who have 开发者_JAVA百科voted on an article. Also want to avoid same user from re-voting again.

I want to store the list of users who have 开发者_JAVA百科voted on an article.

Also want to avoid same user from re-voting again.

What I have now is just use article_id to reference this way,

VOTING : article_id | user_id

ARTICLE : article_id | article_text | rating

Is there a more efficient way to do this?


The database is right the only thing is that the TABLE VOTING should have the pair (article_id | user_id) as unique.
In that way will be impossible to vote twice the same article to the user.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号