parent
0f359082e5
commit
8337331103
@ -0,0 +1,14 @@
|
||||
class AddShixunNameToExQuestion < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :exercise_questions, :shixun_name, :string
|
||||
add_column :exercise_bank_questions, :shixun_name, :string
|
||||
|
||||
ExerciseQuestion.where(question_type: 5).each do |question|
|
||||
question.update_column("shixun_name", question.shixun.try(:name))
|
||||
end
|
||||
|
||||
ExerciseBankQuestion.where(question_type: 5).each do |question|
|
||||
question.update_column("shixun_name", question.shixun.try(:name))
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in new issue