mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 05:05:45 +02:00
parent
ee30c8d4ef
commit
7f308d4123
5 changed files with 73 additions and 0 deletions
|
@ -0,0 +1,15 @@
|
|||
namespace :data_migrations do
|
||||
task delete_orphaned_registrant_verifications: :environment do
|
||||
orphaned_registrant_verifications = RegistrantVerification.where.not(domain_id: Domain.ids)
|
||||
orphaned_registrant_verification_count = orphaned_registrant_verifications.count
|
||||
processed_registrant_verification_count = 0
|
||||
|
||||
orphaned_registrant_verifications.each do |registrant_verification|
|
||||
registrant_verification.destroy!
|
||||
processed_registrant_verification_count += 1
|
||||
end
|
||||
|
||||
puts "Processed: #{processed_registrant_verification_count} out of" \
|
||||
" #{orphaned_registrant_verification_count}"
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue