20191001090809_create_active_job_locks.rb 542 B

1234567891011121314151617
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class CreateActiveJobLocks < ActiveRecord::Migration[5.2]
  3. def change
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. create_table :active_job_locks do |t|
  7. t.string :lock_key
  8. t.string :active_job_id
  9. t.timestamps # rubocop:disable Zammad/ExistsDateTimePrecision
  10. end
  11. add_index :active_job_locks, :lock_key, unique: true
  12. add_index :active_job_locks, :active_job_id, unique: true
  13. end
  14. end