mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 05:05:45 +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
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
|
Loading…
Add table
Add a link
Reference in a new issue