Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun
commit
9bc019565f
@ -0,0 +1,12 @@
|
|||||||
|
class AddIsMdForHomeworks < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
# add_column :homework_commons, :is_md, :boolean, :default => true
|
||||||
|
# add_column :homework_banks, :is_md, :boolean, :default => true
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# add_column :exercise_questions,:is_md, :boolean, :default => true
|
||||||
|
# add_column :poll_questions,:is_md, :boolean, :default => true
|
||||||
|
#
|
||||||
|
# add_column :exercise_bank_questions, :is_md, :boolean, :default => true
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,14 @@
|
|||||||
|
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
|
Loading…
Reference in new issue