diff --git a/db/migrate/20190729095722_delete_error_myshixun_from_myshxiuns.rb b/db/migrate/20190729095722_delete_error_myshixun_from_myshxiuns.rb new file mode 100644 index 000000000..ef5b86975 --- /dev/null +++ b/db/migrate/20190729095722_delete_error_myshixun_from_myshxiuns.rb @@ -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