# == Schema Information
#
# Table name: competitions
#
#  id                      :integer          not null, primary key
#  title                   :string(255)
#  start_time              :datetime
#  end_time                :datetime
#  identifier              :string(255)
#  available               :boolean          default("0")
#  online_time             :datetime
#  visits                  :integer          default("0")
#  competition_lists_count :integer          default("0")
#  min_num                 :integer          default("1")
#  max_num                 :integer          default("1")
#  enroll_end_time         :datetime
#  created_at              :datetime         not null
#  updated_at              :datetime         not null
#  status                  :integer          default("0")
#  subtitle                :string(255)
#  team_members_count      :integer          default("0")
#  limit_type              :integer          default("0")
#  show_top                :integer          default("0")
#  content                 :text(65535)
#  enroll_begin_time       :datetime
#  review_time             :datetime
#  result_time             :datetime
#  org_name                :string(255)
#  show_banner             :boolean          default("0")
#  is_expert_audit         :boolean          default("0")
#  outer_url               :string(255)
#  sort_no                 :integer          default("0")
#  show_index              :boolean          default("0")
#  sub_admin               :string(255)
#

class Competition < ApplicationRecord

  enum status: {archived: 0, active: 1}

  has_many :competition_teams, :dependent => :destroy
  has_many :competition_scores, :dependent => :destroy
end
