mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 03:58:27 +02:00
Change domains.delete_at
database column type to date, rename to
`delete_date` Closes #1125
This commit is contained in:
parent
ab9c5c45de
commit
cea834d5b7
31 changed files with 159 additions and 71 deletions
|
@ -36,7 +36,7 @@ module Serializers
|
|||
legacy_registrar_id: domain.legacy_registrar_id,
|
||||
legacy_registrant_id: domain.legacy_registrant_id,
|
||||
outzone_at: domain.outzone_at,
|
||||
delete_at: domain.delete_at,
|
||||
delete_date: domain.delete_date,
|
||||
registrant_verification_asked_at: domain.registrant_verification_asked_at,
|
||||
registrant_verification_token: domain.registrant_verification_token,
|
||||
pending_json: domain.pending_json,
|
||||
|
|
16
lib/tasks/data_migrations/convert_domain_delete_date.rake
Normal file
16
lib/tasks/data_migrations/convert_domain_delete_date.rake
Normal file
|
@ -0,0 +1,16 @@
|
|||
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,6 +1,6 @@
|
|||
namespace :domains do
|
||||
desc <<~TEXT.gsub("\n", "\s")
|
||||
Releases domains with past `delete_at` by either sending them to the auction or discarding,
|
||||
Releases domains with past `delete_date` by either sending them to the auction or discarding,
|
||||
depending on `release_domains_to_auction` setting
|
||||
TEXT
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue