issues25489
parent
0b1337f0e5
commit
d254907b7d
@ -0,0 +1,6 @@
|
||||
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
|
@ -0,0 +1,7 @@
|
||||
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