20210407000001_setting_add_internal_article_check.rb 1.0 KB

12345678910111213141516171819202122232425
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class SettingAddInternalArticleCheck < 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. # this migration used to have a wrong timestmap
  7. # remove old timestmap from schema_migrations table
  8. # when re-running with the fixed timestamp
  9. # https://github.com/zammad/zammad/issues/3702
  10. return if ActiveRecord::SchemaMigration.where(version: '202104070000001').destroy_all.present?
  11. Setting.create_if_not_exists(
  12. title: 'Define postmaster filter.',
  13. name: '5500_postmaster_internal_article_check',
  14. area: 'Postmaster::PreFilter',
  15. description: 'Defines the postmaster filter which set the article internal if a forwarded, replied or sent email also exists with the article internal received.',
  16. options: {},
  17. state: 'Channel::Filter::InternalArticleCheck',
  18. frontend: false
  19. )
  20. end
  21. end