迁移数据

dev_course
daiao 6 years ago
parent 41f92346db
commit 2243e89077

@ -1,8 +0,0 @@
class SyncShixuninfo < ActiveRecord::Migration[5.2]
def change
Shixun.find_each do |shixun|
ShixunInfo.create!(propaedeutics: shixun.propaedeutics, description: shixun.description,
evaluate_script: shixun.evaluate_script, shixun_id: shixun.id)
end
end
end

@ -1,5 +0,0 @@
class RemoveColumnForShixun < ActiveRecord::Migration[5.2]
def change
remove_columns :shixuns, :description, :propaedeutics, :evaluate_script
end
end

@ -11,5 +11,6 @@ class ModifyScriptAndDescriptionForShixuninfo < ActiveRecord::Migration[5.2]
evaluate_script: shixun[:evaluate_script], shixun_id: shixun.id)
end
end
remove_columns :shixuns, :description, :propaedeutics, :evaluate_script
end
end

Loading…
Cancel
Save