迁移报错

dev_bj
daiao 6 years ago
parent 8bb477ce1e
commit adbbf537da

@ -1,5 +1,8 @@
class AddLimitForShixuns < ActiveRecord::Migration class AddLimitForShixuns < ActiveRecord::Migration
def up def up
if !Challenge.first.has_attribute?(:exec_time)
add_column :challenges, :exec_time, :integer, :default => 120
end
Shixun.find_each do |shixun| Shixun.find_each do |shixun|
shixun.challenges.update_all(:exec_time => shixun.exec_time) shixun.challenges.update_all(:exec_time => shixun.exec_time)
shixun.mirror_repositories.each do |mirror| shixun.mirror_repositories.each do |mirror|

Loading…
Cancel
Save