diff --git a/db/migrate/20191113013258_gcc_course_competition_rank_data.rb b/db/migrate/20191113013258_gcc_course_competition_rank_data.rb new file mode 100644 index 000000000..344d8061c --- /dev/null +++ b/db/migrate/20191113013258_gcc_course_competition_rank_data.rb @@ -0,0 +1,9 @@ +class GccCourseCompetitionRankData < ActiveRecord::Migration[5.2] + def change + competition = Competition.find_by(identifier: 'gcc-course-2019') + stage = competition.competition_stages.first + return if competition.blank? || stage.blank? + + competition.competition_scores.update_all(competition_stage_id: stage.id) + end +end