Commit 64294330 authored by Andreas Brandl's avatar Andreas Brandl

Merge branch '32206-improve-productivity-analytics-post-deploy' into 'master'

Add concurrent index on merged_at for PA Data migration

Closes #32206

See merge request gitlab-org/gitlab!17054
parents 6259a242 333c4f61
# frozen_string_literal: true
class AddMergeRequestMetricsMergedAtIndex < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :merge_request_metrics, [:merged_at, :id]
end
def down
remove_concurrent_index :merge_request_metrics, [:merged_at, :id]
end
end
......@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2019_09_14_223900) do
ActiveRecord::Schema.define(version: 2019_09_18_104222) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
......@@ -2120,6 +2120,7 @@ ActiveRecord::Schema.define(version: 2019_09_14_223900) do
t.index ["latest_closed_by_id"], name: "index_merge_request_metrics_on_latest_closed_by_id"
t.index ["merge_request_id", "merged_at"], name: "index_merge_request_metrics_on_merge_request_id_and_merged_at", where: "(merged_at IS NOT NULL)"
t.index ["merge_request_id"], name: "index_merge_request_metrics"
t.index ["merged_at", "id"], name: "index_merge_request_metrics_on_merged_at_and_id"
t.index ["merged_by_id"], name: "index_merge_request_metrics_on_merged_by_id"
t.index ["pipeline_id"], name: "index_merge_request_metrics_on_pipeline_id"
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment