parent
d254907b7d
commit
0f5885aeb9
@ -1,6 +0,0 @@
|
||||
class AddTeamModeToCompetitions < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :competitions, :team_mode, :boolean, default: 0
|
||||
add_column :competition_staffs, :category_name, :string
|
||||
end
|
||||
end
|
@ -1,7 +0,0 @@
|
||||
class MigrateCompetitionTeamMode < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
Competition.all.each do |competition|
|
||||
competition.update_attributes!(team_mode: 1) unless (competition.competition_staffs.sum(:maximum).to_i == 1 || (competition.competition_staffs.nil? && competition.max_num == 1))
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in new issue