迁移错误数据

dev_forum
daiao 5 years ago
parent b8f0102176
commit 383f796318

@ -0,0 +1,11 @@
class DeleteErrorMyshixunFromMyshxiuns < ActiveRecord::Migration[5.2]
def change
myshixuns = Myshixun.where("created_at > '2019-07-26 00:00:00' and repo_name is null")
myshixuns.find_each do |myshixun|
if myshixun.games.blank?
puts("###########user_login: #{User.find(myshixun.user_id).login}")
myshixun.destroy!
end
end
end
end
Loading…
Cancel
Save