Commit e1d11d10 authored by Stan Hu's avatar Stan Hu

Merge branch 'add-index-to-approvals-mr-id' into 'master'

Add index to approvals.merge_request_id

Closes #2229

See merge request !1695
parents 42f4481d 7a9051e9
---
title: Add index to approvals.merge_request_id
merge_request:
author:
class AddIndexToApprovalsMergeRequestId < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :approvals, :merge_request_id
end
def down
remove_concurrent_index :approvals, :merge_request_id
end
end
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170419065104) do ActiveRecord::Schema.define(version: 20170421113144) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
...@@ -141,6 +141,8 @@ ActiveRecord::Schema.define(version: 20170419065104) do ...@@ -141,6 +141,8 @@ ActiveRecord::Schema.define(version: 20170419065104) do
t.datetime "updated_at" t.datetime "updated_at"
end end
add_index "approvals", ["merge_request_id"], name: "index_approvals_on_merge_request_id", using: :btree
create_table "approver_groups", force: :cascade do |t| create_table "approver_groups", force: :cascade do |t|
t.integer "target_id", null: false t.integer "target_id", null: false
t.string "target_type", null: false t.string "target_type", null: false
......
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