<commit_before>class AddConversationStuffToMixpanel < Mongoid::Migration
  def self.up
    @mixpanel = FactlinkUI::Application.config.mixpanel.new({}, true)

    Message.all.each do |m|
      @mixpanel.increment_person_event m.sender.id.to_s, messages_created: 1
    end
  end

  def self.down<commit_msg>let this migration work with conversations without sender<commit_after>class AddConversationStuffToMixpanel < Mongoid::Migration
  def self.up
    @mixpanel = FactlinkUI::Application.config.mixpanel.new({}, true)

    Message.all.each do |m|
      if m.sender
        @mixpanel.increment_person_event m.sender.id.to_s, messages_created: 1
      end
    end
  end

  def self.down
{'fraction_non_alphanumeric': 0.09210526315789473, 'fraction_numerical': 0.0029239766081871343, 'mean_word_length': 3.892857142857143, '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': '3633969', 'n_tokens_mistral': 225, 'n_tokens_neox': 218, 'n_words': 47}