20191001090809_create_active_job_locks.rb 416 B

123456789101112131415
  1. class CreateActiveJobLocks < ActiveRecord::Migration[5.2]
  2. def change
  3. # return if it's a new setup
  4. return if !Setting.find_by(name: 'system_init_done')
  5. create_table :active_job_locks do |t|
  6. t.string :lock_key
  7. t.string :active_job_id
  8. t.timestamps
  9. end
  10. add_index :active_job_locks, :lock_key, unique: true
  11. add_index :active_job_locks, :active_job_id, unique: true
  12. end
  13. end