class AddColumnToExercise < ActiveRecord::Migration def change add_column :exercise_users, :objective_score, :integer, :default => -1 add_column :exercise_users, :subjective_score, :integer, :default => -1 ExerciseUser.all.each do |eu| eu.update_column('objective_score', eu.score) end end end