<commit_before>class AgentCustomer < ActiveRecord::Migration[5.2]
  def change
    # return if it's a new setup
    return if !Setting.exists?(name: 'system_init_done')

    Role.where(name: %w[Admin Agent Customer]).each do |role|
      role.preferences.delete(:not)
      role.save!
    end

    move_filter
  end

  def move_filter
    Setting.find_by(name: '0010_postmaster_filter_trusted').update(name: '0005_postmaster_filter_trusted')
    Setting.find_by(name: '0020_postmaster_filter_auto_response_check').update(name: '0006_postmaster_filter_auto_response_check')<commit_msg>Fixes #3282 - Unable to upgrade from Zammad 3.3 to 3.6.<commit_after>class AgentCustomer < ActiveRecord::Migration[5.2]
  def change
    # return if it's a new setup
    return if !Setting.exists?(name: 'system_init_done')

    Role.where(name: %w[Admin Agent Customer]).each do |role|
      role.preferences.delete(:not)
      role.update_column(:preferences, role.preferences) # rubocop:disable Rails/SkipsModelValidations
    end

    move_filter
  end

  def move_filter
    Setting.find_by(name: '0010_postmaster_filter_trusted').update(name: '0005_postmaster_filter_trusted')
    Setting.find_by(name: '0020_postmaster_filter_auto_response_check').update(name: '0006_postmaster_filter_auto_response_check')
{'fraction_non_alphanumeric': 0.10185185185185185, 'fraction_numerical': 0.033950617283950615, 'mean_word_length': 5.1469194312796205, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5440256', 'n_tokens_mistral': 451, 'n_tokens_neox': 415, 'n_words': 79}