mirror of
https://github.com/internetee/registry.git
synced 2025-06-09 22:24:47 +02:00
parent
ed27152bb1
commit
4ddbb08e80
19 changed files with 111 additions and 271 deletions
0
lib/tasks/data_migrations/.keep
Normal file
0
lib/tasks/data_migrations/.keep
Normal file
|
@ -1,16 +0,0 @@
|
|||
namespace :data_migrations do
|
||||
task convert_domain_delete_date: :environment do
|
||||
processed_domain_count = 0
|
||||
|
||||
Domain.transaction do
|
||||
Domain.find_each do |domain|
|
||||
next unless domain.delete_date
|
||||
|
||||
domain.update_columns(delete_date: domain.delete_date + 1.day)
|
||||
processed_domain_count += 1
|
||||
end
|
||||
end
|
||||
|
||||
puts "Domains processed: #{processed_domain_count}"
|
||||
end
|
||||
end
|
|
@ -1,15 +0,0 @@
|
|||
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
|
|
@ -1,16 +0,0 @@
|
|||
namespace :data_migrations do
|
||||
task regenerate_registrar_reference_numbers: [:environment] do
|
||||
processed_registrar_count = 0
|
||||
|
||||
Registrar.transaction do
|
||||
Registrar.all.each do |registrar|
|
||||
next unless registrar.reference_no.start_with?('RF')
|
||||
|
||||
registrar.update_columns(reference_no: Billing::ReferenceNo.generate)
|
||||
processed_registrar_count += 1
|
||||
end
|
||||
end
|
||||
|
||||
puts "Registrars processed: #{processed_registrar_count}"
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue