You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
394 B
12 lines
394 B
5 years ago
|
class ChangeEcCourseSupports < ActiveRecord::Migration[5.2]
|
||
|
def change
|
||
|
add_column :ec_course_supports, :ec_graduation_subitem_id, :integer, index: true
|
||
|
|
||
|
execute <<-SQL
|
||
|
UPDATE ec_course_supports ecs SET ec_graduation_subitem_id = (
|
||
|
SELECT ec_graduation_subitem_id FROM ec_graduation_subitem_courses egsc WHERE egsc.ec_course_support_id = ecs.id
|
||
|
)
|
||
|
SQL
|
||
|
end
|
||
|
end
|