<commit_before>class TrustedPostFields < ActiveRecord::Migration
    def self.up
        add_column :posts, :trusted, :boolean, :null => false, :default => '0'
        Discussion.find(:all, :conditions => 'trusted = 1').each do |discussion|
            Post.update_all("trusted = 1", "discussion_id = #{discussion.id}")
        end
    end

    def self.down
        remove_column :posts, :trusted
    end<commit_msg>Added indexes to cached trusted status<commit_after>class TrustedPostFields < ActiveRecord::Migration
    def self.up
        add_column :posts, :trusted, :boolean, :null => false, :default => '0'
        Discussion.find(:all, :conditions => 'trusted = 1').each do |discussion|
            Post.update_all("trusted = 1", "discussion_id = #{discussion.id}")
        end
        add_index :posts, :trusted, :name => 'trusted_index'
        add_index :discussions, :trusted, :name => 'trusted_index'
    end

    def self.down
        remove_index :posts, :name => 'trusted_index'
        remove_index :discussions, :name => 'trusted_index'
        remove_column :posts, :trusted
    end
{'fraction_non_alphanumeric': 0.1271571298819255, 'fraction_numerical': 0.005449591280653951, 'mean_word_length': 3.111940298507463, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '247054', 'n_tokens_mistral': 343, 'n_tokens_neox': 329, 'n_words': 84}