discourse-topic-voting/app/models/discourse_topic_voting/vote.rb
Natalie Tay 3d3037729c
DEV: Scope topic voting tables to avoid confusion with post voting (#196)
Renaming discourse_voting to topic_voting since there are two forms of voting in Discourse - posts and topics.

This PR also moves a OnceOff into a post migration. The post migration will be executed, but should ideally be a no-op. This allows us to not have to maintain the OnceOff as it had to be modified before with a previous migration. I considered removing this file altogether, but I don't think there is anything negative from just converting it into a migration, and it might be useful in the unlikely scenario that a forum from the past has never ran the OnceOff before.
2024-07-17 20:26:40 +08:00

26 lines
576 B
Ruby

# frozen_string_literal: true
module DiscourseTopicVoting
class Vote < ActiveRecord::Base
self.table_name = "topic_voting_votes"
belongs_to :user
belongs_to :topic
end
end
# == Schema Information
#
# Table name: topic_voting_votes
#
# id :bigint not null, primary key
# topic_id :integer
# user_id :integer
# archive :boolean default(FALSE)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_topic_voting_votes_on_user_id_and_topic_id (user_id,topic_id) UNIQUE
#