Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20231013181758_remove_temp_index_for_project_statistics_pipeline_artifacts_size_migration.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 399fdca93f465d4d5be12ffd6ae9e4dfd2383d6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

class RemoveTempIndexForProjectStatisticsPipelineArtifactsSizeMigration < Gitlab::Database::Migration[2.1]
  INDEX_PROJECT_STATSISTICS_PIPELINE_ARTIFACTS_SIZE = 'tmp_index_project_statistics_pipeline_artifacts_size'

  disable_ddl_transaction!

  def up
    remove_concurrent_index_by_name :project_statistics, INDEX_PROJECT_STATSISTICS_PIPELINE_ARTIFACTS_SIZE
  end

  def down
    add_concurrent_index :project_statistics, [:project_id],
      name: INDEX_PROJECT_STATSISTICS_PIPELINE_ARTIFACTS_SIZE,
      where: "pipeline_artifacts_size != 0"
  end
end