<commit_before><commit_msg>Add some nice indexes<commit_after>class AddIndexesToDistributionModels < ActiveRecord::Migration
  def self.up
    add_index :distribution_plugin_delivery_methods, :node_id
    add_index :distribution_plugin_products, :supplier_id
    add_index :distribution_plugin_products, :session_id
    add_index :distribution_plugin_products, :product_id
    add_index :distribution_plugin_products, :node_id
    add_index :distribution_plugin_products, :unit_id
    add_index :distribution_plugin_products, :archived
    add_index :distribution_plugin_source_products, :from_product_id
    add_index :distribution_plugin_source_products, :to_product_id
    add_index :distribution_plugin_ordered_products, :session_product_id
    add_index :distribution_plugin_ordered_products, :order_id
    add_index :distribution_plugin_nodes, :profile_id
    add_index :distribution_plugin_delivery_options, :session_id
    add_index :distribution_plugin_delivery_options, :delivery_method_id
    add_index :distribution_plugin_delivery_options, [:session_id, :delivery_method_id]
    add_index :distribution_plugin_sessions, :node_id
    add_index :distribution_plugin_sessions, :status
    add_index :distribution_plugin_suppliers, :node_id
    add_index :distribution_plugin_suppliers, :consumer_id
    add_index :distribution_plugin_orders, :session_id
    add_index :distribution_plugin_orders, :consumer_id
    add_index :distribution_plugin_orders, :supplier_delivery_id
    add_index :distribution_plugin_orders, :consumer_delivery_id
    add_index :distribution_plugin_orders, :status
  end

  def self.down
    remove_index :distribution_plugin_delivery_methods, :node_id
    remove_index :distribution_plugin_products, :supplier_id
    remove_index :distribution_plugin_products, :session_id
    remove_index :distribution_plugin_products, :product_id
    remove_index :distribution_plugin_products, :node_id
    remove_index :distribution_plugin_products, :unit_id
    remove_index :distribution_plugin_products, :archived
    remove_index :distribution_plugin_source_products, :from_product_id
    remove_index :distribution_plugin_source_products, :to_product_id
    remove_index :distribution_plugin_ordered_products, :session_product_id
    remove_index :distribution_plugin_ordered_products, :order_id
    remove_index :distribution_plugin_nodes, :profile_id
    remove_index :distribution_plugin_delivery_options, :session_id
    remove_index :distribution_plugin_delivery_options, :delivery_method_id
    remove_index :distribution_plugin_delivery_options, [:session_id, :delivery_method_id]
    remove_index :distribution_plugin_sessions, :node_id
    remove_index :distribution_plugin_sessions, :status
    remove_index :distribution_plugin_suppliers, :node_id
    remove_index :distribution_plugin_suppliers, :consumer_id
    remove_index :distribution_plugin_orders, :session_id
    remove_index :distribution_plugin_orders, :consumer_id
    remove_index :distribution_plugin_orders, :supplier_delivery_id
    remove_index :distribution_plugin_orders, :consumer_delivery_id
    remove_index :distribution_plugin_orders, :status
  end
end

{'fraction_non_alphanumeric': 0.0514520202020202, 'fraction_numerical': 0.0, 'mean_word_length': 7.706043956043956, 'pattern_counts': {'":': 0, '<': 4, '<?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': '6724331', 'n_tokens_mistral': 969, 'n_tokens_neox': 912, 'n_words': 159}