Commit eb6f5f45 by liangyuzhe

删除rake 任务

parent c0eaed2e
namespace :data_migrations do
namespace :version do
desc "batch delete notification_statistics data"
task :v1_batch_delete_notification_statistics_data => :environment do
last_object = NotificationStatistic.where("notification_statistics.created_at >= ?", '2020-05-30 16:00:00').first
puts "rake begin time is #{Time.now.to_s}"
NotificationStatistic.in_batches(of: 10000, finish: last_object ) {|records| records.delete_all} if last_object.present?
puts "rake end time is #{Time.now.to_s}"
end
end
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment