trabajo-afectivo/db/migrate/20191001090809_create_active_job_locks.rb

16 lines
416 B
Ruby
Raw Normal View History

class CreateActiveJobLocks < ActiveRecord::Migration[5.2]
def change
# return if it's a new setup
return if !Setting.find_by(name: 'system_init_done')
create_table :active_job_locks do |t|
t.string :lock_key
t.string :active_job_id
t.timestamps
end
add_index :active_job_locks, :lock_key, unique: true
add_index :active_job_locks, :active_job_id, unique: true
end
end