Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unknown attribute: queue with delayed_job after update of rails 3.2.11

All in the title. After the security warning, I updated my rails 3.2.3 to 3.2.11 Every things ok but I realize that the delayed job doesn't send messages anymore with the error "unknown attribute: queue"

I tried to recreate the update migration : rails generate delayed_job:upgrade But it tell me that already exist.

like image 389
Rufilix Avatar asked Dec 12 '25 14:12

Rufilix


2 Answers

Run rake db:migrate

rails generate delayed_job:upgrade generated a migration but your database doesn't get modified until you actually run the migration.

Hope that helps!

like image 75
brettish Avatar answered Dec 17 '25 00:12

brettish


Alternate to @brettish's answer, you can do it by yourself (I am writing this because, I ran into same issue and delayed_job:upgrade generator was undefined for me).

In version 3, queue attribute is added.

You can follow these steps:

Create migration rails generate migration AddQueueToDelayedJobs

Add queue to delayed_jobs table as follows:

class AddQueueToDelayedJobs < ActiveRecord::Migration[5.1]
  def self.up
    add_column :delayed_jobs, :queue, :string
  end
  def self.down
    remove_column :delayed_jobs, :queue
  end
end

Note: I am using rails 5.1.

Hope it helps!

like image 24
Dusht Avatar answered Dec 16 '25 23:12

Dusht



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!