<commit_before>class MigrateTokenizedPermissions < ActiveRecord::Migration
  def concat(str1, str2)
    dbtype = Rails.configuration.database_configuration[Rails.env]['adapter'].to_sym

    case dbtype
    when :mysql, :mysql2
      "CONCAT(#{str1}, #{str2})"
    when :sqlserver
      "(#{str1} + #{str2})"
    else
      "(#{str1} || #{str2})"
    end
  end

  def up
    execute "UPDATE spree_tokenized_permissions SET permissable_type = #{concat("'Spree::'", "permissable_type")}" +
            " where permissable_type NOT LIKE 'Spree::%' AND permissable_type IS NOT NULL"
  end

  def down
    execute "UPDATE spree_tokenized_permissions SET permissable_type = REPLACE(permissable_type, 'Spree::', '')" + 
            " where permissable_type LIKE 'Spree::%'"
  end
end<commit_msg>[auth] Upcase the SQL syntax<commit_after>class MigrateTokenizedPermissions < ActiveRecord::Migration
  def concat(str1, str2)
    dbtype = Rails.configuration.database_configuration[Rails.env]['adapter'].to_sym

    case dbtype
    when :mysql, :mysql2
      "CONCAT(#{str1}, #{str2})"
    when :sqlserver
      "(#{str1} + #{str2})"
    else
      "(#{str1} || #{str2})"
    end
  end

  def up
    execute "UPDATE spree_tokenized_permissions SET permissable_type = #{concat("'Spree::'", "permissable_type")}" +
            " WHERE permissable_type NOT LIKE 'Spree::%' AND permissable_type IS NOT NULL"
  end

  def down
    execute "UPDATE spree_tokenized_permissions SET permissable_type = REPLACE(permissable_type, 'Spree::', '')" + 
            " WHERE permissable_type LIKE 'Spree::%'"
  end
end
{'fraction_non_alphanumeric': 0.13215859030837004, 'fraction_numerical': 0.011327879169288861, 'mean_word_length': 3.8036253776435047, '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': '14696', 'n_tokens_mistral': 542, 'n_tokens_neox': 532, 'n_words': 121}