迁移报错

dev_forum
daiao 5 years ago
parent cd32ece4f2
commit b8f0102176

@ -3,7 +3,7 @@ class ModifyLoginForUsers < ActiveRecord::Migration[5.2]
users = User.where("created_on > '2019-07-26 19:00:00'") users = User.where("created_on > '2019-07-26 19:00:00'")
users.find_each do |use| users.find_each do |use|
use.update_attributes(login: use.login&.strip, phone: use.phone&.strip) use.update_attributes(login: use.login&.strip, phone: use.phone&.strip)
use.user_extension.update_column(:student_id, use.user_extension&.student_id&.strip) use.user_extension.update_column(:student_id, use.user_extension&.student_id&.strip) if use.user_extension
end end
end end
end end

Loading…
Cancel
Save