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
|