Commit 333c4f61 authored by Pavel Shutsin's avatar Pavel Shutsin 🔮

Add temporary index for PA data migration

parent cd0d97c0
Pipeline #82929640 passed with stages
in 100 minutes and 51 seconds
# 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