<commit_before>class SuperclassTrackbacks < ActiveRecord::Migration
  class BareContent < ActiveRecord::Base
    include BareMigration
    set_inheritance_column :bogustype     # see migration #20 for why
  end

  class BareTrackback < ActiveRecord::Base
    include BareMigration
  end

  def self.up
    say "Merging Trackbacks into Content table"
    # Ensure that the index we're going to remove in the transaction
    # is actually there (otherwise Postgres breaks)
    # Comment because already in migration 001
    #add_index(:trackbacks, :article_id) rescue nil
    modify_tables_and_update([:add_column,   BareContent,   :blog_name, :string],
                             [:remove_index, BareTrackback, :article_id        ]) do
      BareContent.transaction do
        if not $schema_generator
          BareTrackback.find(:all).each do |tb|
            a = BareContent.find(tb.article_id)
            BareContent.create(:type       => 'Trackback',
                               :article_id => tb.article_id,
                               :blog_name  => tb.blog_name,
                               :title      => tb.title,
                               :excerpt    => tb.excerpt,
                               :url        => tb.url,
                               :ip         => tb.ip,
                               :created_at => tb.created_at,
                               :updated_at => tb.updated_at,
                               :guid       => tb.guid)
          end
        end
      end
    end<commit_msg>removes another failing remove_index<commit_after>class SuperclassTrackbacks < ActiveRecord::Migration
  class BareContent < ActiveRecord::Base
    include BareMigration
    set_inheritance_column :bogustype     # see migration #20 for why
  end

  class BareTrackback < ActiveRecord::Base
    include BareMigration
  end

  def self.up
    say "Merging Trackbacks into Content table"
    # Ensure that the index we're going to remove in the transaction
    # is actually there (otherwise Postgres breaks)
    # Comment because already in migration 001
    #add_index(:trackbacks, :article_id) rescue nil
    modify_tables_and_update([:add_column,   BareContent,   :blog_name, :string]) do
      BareContent.transaction do
        if not $schema_generator
          BareTrackback.find(:all).each do |tb|
            a = BareContent.find(tb.article_id)
            BareContent.create(:type       => 'Trackback',
                               :article_id => tb.article_id,
                               :blog_name  => tb.blog_name,
                               :title      => tb.title,
                               :excerpt    => tb.excerpt,
                               :url        => tb.url,
                               :ip         => tb.ip,
                               :created_at => tb.created_at,
                               :updated_at => tb.updated_at,
                               :guid       => tb.guid)
          end
        end
      end
    end
{'fraction_non_alphanumeric': 0.0735440931780366, 'fraction_numerical': 0.0033277870216306157, 'mean_word_length': 1.5133779264214047, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2874731', 'n_tokens_mistral': 787, 'n_tokens_neox': 779, 'n_words': 197}