Commit a015e922 authored by Pavel Shutsin's avatar Pavel Shutsin

Replace Productivity analytics merged_at index

parent c6f8105a
# frozen_string_literal: true
class ReplaceIndexOnMetricsMergedAt < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :merge_request_metrics, :merged_at
remove_concurrent_index :merge_request_metrics, [:merged_at, :id]
end
def down
add_concurrent_index :merge_request_metrics, [:merged_at, :id]
remove_concurrent_index :merge_request_metrics, :merged_at
end
end
......@@ -6,7 +6,7 @@ class ScheduleProductivityAnalyticsBackfill < ActiveRecord::Migration[5.2]
DOWNTIME = false
def up
# no-op since the scheduling times out on GitLab.com
# no-op since the migration was removed
end
def down
......
......@@ -2290,7 +2290,7 @@ ActiveRecord::Schema.define(version: 2019_11_05_094625) 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_at"], name: "index_merge_request_metrics_on_merged_at"
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