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.
educoder/db/migrate/20190726083814_migrate_cour...

15 lines
765 B

class MigrateCourseIsMd < ActiveRecord::Migration[5.2]
def change
# HomeworkCommon.where(homework_type: [1, 3]).where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false)
# HomeworkBank.where(homework_type: [1, 3]).where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false)
#
# HomeworkCommon.where(homework_type: [1, 3]).where("created_at >= '2019-07-21 00:00:00' and homework_bank_id is not null").each do |homework|
#
# end
#
# ExerciseQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false)
# PollQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false)
# ExerciseBankQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false)
end
end