<commit_before>class Phobos03AddCreatedAtToEvents < ActiveRecord::Migration[<%= ActiveRecord::VERSION::STRING.to_f %>]
  def up
    add_column :phobos_db_checkpoint_events, :created_at, :datetime

    say 'Adding index for phobos_db_checkpoint_events created_at desc nulls last'
    ActiveRecord::Base.connection.execute <<-SQL
      CREATE INDEX phobos_events_created_at_desc_nulls_last_idx
        ON phobos_db_checkpoint_events(
          created_at DESC NULLS LAST
        );
    SQL

    say 'Adding index for phobos_db_checkpoint_events event_time desc nulls last'
    ActiveRecord::Base.connection.execute <<-SQL
      CREATE INDEX phobos_events_event_time_desc_nulls_last_idx
        ON phobos_db_checkpoint_events(
          event_time DESC NULLS LAST
        );
    SQL

    say 'Adding index for phobos_db_checkpoint_failures created_at desc nulls last'
    ActiveRecord::Base.connection.execute <<-SQL
      CREATE INDEX phobos_failures_created_at_desc_nulls_last_idx
        ON phobos_db_checkpoint_failures(
          created_at DESC NULLS LAST
        );
    SQL

    say 'Adding index for phobos_db_checkpoint_failures event_time desc nulls last'
    ActiveRecord::Base.connection.execute <<-SQL
      CREATE INDEX phobos_failures_event_time_desc_nulls_last_idx
        ON phobos_db_checkpoint_failures(
          event_time DESC NULLS LAST
        );
    SQL
  end

  def down
    remove_column :phobos_db_checkpoint_events, :created_at
  end
end<commit_msg>Add down migration<commit_after>class Phobos03AddCreatedAtToEvents < ActiveRecord::Migration[<%= ActiveRecord::VERSION::STRING.to_f %>]
  def up
    add_column :phobos_db_checkpoint_events, :created_at, :datetime

    say 'Adding index for phobos_db_checkpoint_events created_at desc nulls last'
    ActiveRecord::Base.connection.execute <<-SQL
      CREATE INDEX phobos_events_created_at_desc_nulls_last_idx
        ON phobos_db_checkpoint_events(
          created_at DESC NULLS LAST
        );
    SQL

    say 'Adding index for phobos_db_checkpoint_events event_time desc nulls last'
    ActiveRecord::Base.connection.execute <<-SQL
      CREATE INDEX phobos_events_event_time_desc_nulls_last_idx
        ON phobos_db_checkpoint_events(
          event_time DESC NULLS LAST
        );
    SQL

    say 'Adding index for phobos_db_checkpoint_failures created_at desc nulls last'
    ActiveRecord::Base.connection.execute <<-SQL
      CREATE INDEX phobos_failures_created_at_desc_nulls_last_idx
        ON phobos_db_checkpoint_failures(
          created_at DESC NULLS LAST
        );
    SQL

    say 'Adding index for phobos_db_checkpoint_failures event_time desc nulls last'
    ActiveRecord::Base.connection.execute <<-SQL
      CREATE INDEX phobos_failures_event_time_desc_nulls_last_idx
        ON phobos_db_checkpoint_failures(
          event_time DESC NULLS LAST
        );
    SQL
  end

  def down
    say 'Removing index phobos_events_created_at_desc_nulls_last_idx'
    ActiveRecord::Base.connection.execute <<-SQL
      DROP INDEX phobos_events_created_at_desc_nulls_last_idx;
    SQL

    say 'Removing index phobos_events_event_time_desc_nulls_last_idx'
    ActiveRecord::Base.connection.execute <<-SQL
      DROP INDEX phobos_events_event_time_desc_nulls_last_idx;
    SQL

    say 'Removing index phobos_failures_created_at_desc_nulls_last_idx'
    ActiveRecord::Base.connection.execute <<-SQL
      DROP INDEX phobos_failures_created_at_desc_nulls_last_idx;
    SQL

    say 'Removing index phobos_failures_event_time_desc_nulls_last_idx'
    ActiveRecord::Base.connection.execute <<-SQL
      DROP INDEX phobos_failures_event_time_desc_nulls_last_idx;
    SQL

    remove_column :phobos_db_checkpoint_events, :created_at
  end
end
{'fraction_non_alphanumeric': 0.05044271532063322, 'fraction_numerical': 0.0010732492621411322, 'mean_word_length': 3.873202614379085, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 5, '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': '6718431', 'n_tokens_mistral': 1263, 'n_tokens_neox': 1222, 'n_words': 245}