数据迁移不完整
This commit is contained in:
parent
bdbcc52320
commit
8d23815169
|
@ -2,8 +2,9 @@ class AddScoreToWork < ActiveRecord::Migration
|
|||
require 'bigdecimal'
|
||||
|
||||
def up
|
||||
count = StudentWork.all.count / 10 + 1
|
||||
transaction do
|
||||
for i in 1 ... 1000 do i
|
||||
for i in 1 ... count do i
|
||||
StudentWork.page(i).per(10).each do |work|
|
||||
teacher_score = work.student_works_scores.where(:reviewer_role => 1).order("created_at desc")
|
||||
unless teacher_score.empty?
|
||||
|
@ -43,8 +44,9 @@ class AddScoreToWork < ActiveRecord::Migration
|
|||
end
|
||||
|
||||
def down
|
||||
count = StudentWork.all.count / 10 + 1
|
||||
transaction do
|
||||
for i in 1 ... 1000 do i
|
||||
for i in 1 ... count do i
|
||||
StudentWork.page(i).per(10).each do |work|
|
||||
work.teacher_score = nil
|
||||
work.teaching_asistant_score = nil
|
||||
|
|
Loading…
Reference in New Issue