From 804375d1aa785e3c4c1c0244b7c4944a3afef255 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Wed, 20 Mar 2019 11:22:33 +0000 Subject: [PATCH] Delete obsolete pending delayed jobs related to the deleted account invoices feature --- .../20190320111312_delete_obsolete_pending_jobs.rb | 9 +++++++++ db/schema.rb | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20190320111312_delete_obsolete_pending_jobs.rb diff --git a/db/migrate/20190320111312_delete_obsolete_pending_jobs.rb b/db/migrate/20190320111312_delete_obsolete_pending_jobs.rb new file mode 100644 index 0000000000..043612971c --- /dev/null +++ b/db/migrate/20190320111312_delete_obsolete_pending_jobs.rb @@ -0,0 +1,9 @@ +class DeleteObsoletePendingJobs < ActiveRecord::Migration + def up + Delayed::Job.all.each do |job| + job.delete if job.name == "FinalizeAccountInvoices" || + job.name == "UpdateAccountInvoices" || + job.name == "UpdateBillablePeriods" + end + end +end diff --git a/db/schema.rb b/db/schema.rb index b70cb1450c..43c88ccc9a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20190315224423) do +ActiveRecord::Schema.define(:version => 20190320111312) do create_table "adjustment_metadata", :force => true do |t| t.integer "adjustment_id"