OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/db/migrate/20200422105623_add_job_stat...

25 lines
605 B

class AddJobStatus < ActiveRecord::Migration[6.0]
def up
execute <<-SQL
CREATE TYPE delayed_job_status AS ENUM ('in_queue', 'error', 'in_process', 'success', 'failure');
SQL
create_table :delayed_job_statuses do |t|
t.references :job
t.references :reference, polymorphic: true, index: { unique: true }
t.string :message
t.timestamps
end
add_column :delayed_job_statuses, :status, :delayed_job_status, default: 'in_queue'
end
def down
drop_table :delayed_job_statuses
execute <<-SQL
DROP TYPE delayed_job_status;
SQL
end
end