Files
danbooru/db/migrate/20220104214319_drop_delayed_jobs.rb
evazion 3841fba78e jobs: remove DelayedJobs.
Remove the DelayedJobs gem and database table. Completes the transition
to GoodJob started in c06bfa64f and f4953549a.

Downstream users can upgrade as follows:

* Stop the Rails server.
* Stop the DelayedJobs worker (normally running as `bin/delayed_job` or `bin/rails jobs:work`).
* Run `bin/rails jobs:work` to finish any pending delayed jobs.
* Run `bin/rails db:migrate` to create the good_jobs table and drop the delayed_jobs table.
* Start the Rails server again.
* Start the GoodJobs worker with `bin/good_job start`.
2022-01-04 15:58:12 -06:00

25 lines
580 B
Ruby

class DropDelayedJobs < ActiveRecord::Migration[6.1]
def up
drop_table :delayed_jobs
end
def down
create_table :delayed_jobs do |t|
t.integer :priority, default: 0
t.integer :attempts, default: 0
t.text :handler
t.text :last_error
t.datetime :run_at
t.datetime :locked_at
t.datetime :failed_at
t.string :locked_by
t.timestamps null: false
t.string :queue
end
add_index :delayed_jobs, :run_at
add_index :delayed_jobs, :locked_at
add_index :delayed_jobs, :locked_by
end
end