Change domains.delete_at database column type to date, rename to

`delete_date`

Closes #1125
This commit is contained in:
Artur Beljajev 2019-03-28 17:36:38 +02:00
parent ab9c5c45de
commit cea834d5b7
31 changed files with 159 additions and 71 deletions

View 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

View file

@ -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