<commit_before># frozen_string_literal: true

class AddIndexToDeployments < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    remove_concurrent_index :deployments, [:project_id, :status]
    remove_concurrent_index :deployments, [:environment_id, :status]
    add_concurrent_index :deployments, [:project_id, :status, :id]
    add_concurrent_index :deployments, [:project_id, :status, :iid]
    add_concurrent_index :deployments, [:environment_id, :status, :id]
    add_concurrent_index :deployments, [:environment_id, :status, :iid]
    add_concurrent_index :deployments, [:environment_id, :sha]
  end

  def down
    add_concurrent_index :deployments, [:project_id, :status]
    add_concurrent_index :deployments, [:environment_id, :status]
    remove_concurrent_index :deployments, [:project_id, :status, :id]
    remove_concurrent_index :deployments, [:project_id, :status, :iid]
    remove_concurrent_index :deployments, [:environment_id, :status, :id]
    remove_concurrent_index :deployments, [:environment_id, :status, :iid]
    remove_concurrent_index :deployments, [:environment_id, :sha]
  end
end<commit_msg>Revert add action follow up 2<commit_after># frozen_string_literal: true

class AddIndexToDeployments < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_index :deployments, [:project_id, :status, :id]
    add_concurrent_index :deployments, [:project_id, :status, :iid]
    add_concurrent_index :deployments, [:environment_id, :status, :id]
    add_concurrent_index :deployments, [:environment_id, :status, :iid]
    add_concurrent_index :deployments, [:environment_id, :sha]
  end

  def down
    remove_concurrent_index :deployments, [:project_id, :status, :id]
    remove_concurrent_index :deployments, [:project_id, :status, :iid]
    remove_concurrent_index :deployments, [:environment_id, :status, :id]
    remove_concurrent_index :deployments, [:environment_id, :status, :iid]
    remove_concurrent_index :deployments, [:environment_id, :sha]
  end
end
{'fraction_non_alphanumeric': 0.10575139146567718, 'fraction_numerical': 0.00046382189239332097, 'mean_word_length': 6.437931034482759, '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': '5995842', 'n_tokens_mistral': 721, 'n_tokens_neox': 695, 'n_words': 152}