<commit_before>Sequel.migration do

  up do
    add_column :gateways, :hashed_id, String
    add_index  :gateways, :hashed_id, unique: true
    if defined?(StraightServer)
      StraightServer.db_connection[:gateways].each do |g|
        g.update(hashed_id: OpenSSL::HMAC.digest('sha256', StraightServer::Config.server_secret, g[:id].to_s).unpack("H*").first)
      end
    end
  end

  down do
    remove_index  :gateways, :hashed_id
    remove_column :gateways, :hashed_id<commit_msg>Fix: update migration, remove unique constraint for Gateway#hashed_id<commit_after>Sequel.migration do

  up do
    add_column :gateways, :hashed_id, String
    add_index  :gateways, :hashed_id
    if defined?(StraightServer)
      StraightServer.db_connection[:gateways].each do |g|
        g.update(hashed_id: OpenSSL::HMAC.digest('sha256', StraightServer::Config.server_secret, g[:id].to_s).unpack("H*").first)
      end
    end
  end

  down do
    remove_index  :gateways, :hashed_id
    remove_column :gateways, :hashed_id
{'fraction_non_alphanumeric': 0.11143984220907298, 'fraction_numerical': 0.005917159763313609, 'mean_word_length': 4.178571428571429, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1781005', 'n_tokens_mistral': 364, 'n_tokens_neox': 352, 'n_words': 70}