Add que data migration & move CsyncJob to AppilcationJob

This commit is contained in:
Alex Sherman 2021-04-05 13:22:59 +05:00
parent 7210140de6
commit 83706a78e3
3 changed files with 25 additions and 8 deletions

View file

@ -0,0 +1,17 @@
class MigrateQueJobs < ActiveRecord::Migration[6.0]
def up
QueJob.all.each do |job|
next if job.last_error.present?
klass = job.job_class.constantize
next unless klass < ApplicationJob
args = job.args
klass.perform_later(args)
end
end
def down
raise ActiveRecord::IrreversibleMigration
end
end