diff --git a/db/migrate/20160421011543_alter_homework_end_time.rb b/db/migrate/20160421011543_alter_homework_end_time.rb new file mode 100644 index 000000000..4470bd63b --- /dev/null +++ b/db/migrate/20160421011543_alter_homework_end_time.rb @@ -0,0 +1,21 @@ +class AlterHomeworkEndTime < ActiveRecord::Migration + def up + homeworks = HomeworkCommon.where("id in (3229, 3234, 3235, 3236)"); + unless homeworks.empty? || homeworks.nil? + homeworks.each do |hw| + hw.end_time = hw.end_time + 4 + hm = hw.homework_detail_manual + hm.comment_status = 1 + hw.student_works.each do |stu| + stu.late_penalty = 0 + stu.save + end + hm.save + hw.save + end + end + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 124870b49..7e84996e6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160418074429) do +ActiveRecord::Schema.define(:version => 20160421011543) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false