这其中有一个用户表,一个帖子表和一个投票表,在其中,喜欢,不喜欢,爱和愤怒存储在单独的列中
User (userId, email, password..)
Post (postId, link, summary...)
PostVotes (postVoteId, likes, dislikes, love, anger)
UserVotes (userVoteId, userId references User.userId, postVoteId references PostVotes.postVoteId)
Comments (commentId, parentCommenId, comment, publishedDate, userId)
CommentVotes (commentVoteId, likes, dislikes, commentId references Comments.commentId)
UserCommentVotes (userCommentVoteId, commentVoteId references CommentVotes, userId references User.userId)
而不是保留2个单独的表格来进行投票和评论投票,而是制作一个名为Votes的表格
Votes (itemId, userId, vote)
我的查询将是在无限滚动页面中的每次加载中加载50个帖子。我需要得到喜欢每个人都不喜欢的爱和愤怒。有什么建议吗?