20230404092742_issue_4484_time_based_trigger.rb 899 B

1234567891011121314151617181920212223242526
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Issue4484TimeBasedTrigger < ActiveRecord::Migration[6.1]
  3. def up
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. change_table :triggers do |t|
  7. t.string :activator, limit: 50, null: false, default: 'action'
  8. t.string :execution_condition_mode, limit: 50, null: false, default: 'selective'
  9. t.index %i[active activator]
  10. end
  11. Trigger.reset_column_information
  12. Setting.create_if_not_exists(
  13. title: 'Defines transaction backend.',
  14. name: '9200_time_based_trigger',
  15. area: 'Transaction::Backend::Async',
  16. description: 'Defines the transaction backend which executes time based triggers.',
  17. options: {},
  18. state: 'Transaction::TimeBasedTrigger',
  19. frontend: false
  20. )
  21. end
  22. end