We shouldn't add vote fields for personal messages since users can't vote there. If we include then it's creating an N+1 issue in the `private-messages-all` endpoint.
The `Topic#update_vote_count` method should be concurrency-safe to prevent unique constraint violation errors when multiple processes try to insert a topic_votes_count record for the same topic simultaneously.
Signed-off-by: OsamaSayegh <asooomaasoooma90@gmail.com>
We are trying to avoid custom tables. Changes:
CategoryCustomField -> DiscourseVoting::CategorySetting # contains infromation if voting is enabled for category
UserCustomField -> DiscourseVoting::Vote # user's votes
TopicCustomField -> DiscourseVoting::VoteCounter # cache count for topics