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

18 lines
542 B
Ruby
Raw Permalink Normal View History

2022-01-01 13:38:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
class CreateActiveJobLocks < ActiveRecord::Migration[5.2]
def change
# return if it's a new setup
return if !Setting.exists?(name: 'system_init_done')
create_table :active_job_locks do |t|
t.string :lock_key
t.string :active_job_id
t.timestamps # rubocop:disable Zammad/ExistsDateTimePrecision
end
add_index :active_job_locks, :lock_key, unique: true
add_index :active_job_locks, :active_job_id, unique: true
end
end