diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2017-06-21 15:12:16 +0300 |
---|---|---|
committer | kushalpandya <kushal@gitlab.com> | 2017-06-21 15:50:54 +0300 |
commit | 3d5526a0e84d3efa208c98339a14690b51a1827d (patch) | |
tree | 279c5eb9066d0566bfd4a72ecbf47c8cd65a2781 | |
parent | 54276d39478ed0918ca48f5a318256d5c6b76a50 (diff) |
Merge branch 'add-index-for-head-pipeline-id' into 'master'
Add index for head pipeline
See merge request !12273
-rw-r--r-- | db/migrate/20170619144837_add_index_for_head_pipeline_merge_request.rb | 15 | ||||
-rw-r--r-- | db/schema.rb | 4 |
2 files changed, 18 insertions, 1 deletions
diff --git a/db/migrate/20170619144837_add_index_for_head_pipeline_merge_request.rb b/db/migrate/20170619144837_add_index_for_head_pipeline_merge_request.rb new file mode 100644 index 00000000000..02863bee082 --- /dev/null +++ b/db/migrate/20170619144837_add_index_for_head_pipeline_merge_request.rb @@ -0,0 +1,15 @@ +class AddIndexForHeadPipelineMergeRequest < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :merge_requests, :head_pipeline_id + end + + def down + remove_concurrent_index :merge_requests, :head_pipeline_id if index_exists?(:merge_requests, :head_pipeline_id) + end +end diff --git a/db/schema.rb b/db/schema.rb index b93630a410d..d5c12cead72 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,8 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20170606202615) do +ActiveRecord::Schema.define(version: 20170619144837) do + # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" enable_extension "pg_trgm" @@ -760,6 +761,7 @@ ActiveRecord::Schema.define(version: 20170606202615) do add_index "merge_requests", ["created_at"], name: "index_merge_requests_on_created_at", using: :btree add_index "merge_requests", ["deleted_at"], name: "index_merge_requests_on_deleted_at", using: :btree add_index "merge_requests", ["description"], name: "index_merge_requests_on_description_trigram", using: :gin, opclasses: {"description"=>"gin_trgm_ops"} + add_index "merge_requests", ["head_pipeline_id"], name: "index_merge_requests_on_head_pipeline_id", using: :btree add_index "merge_requests", ["milestone_id"], name: "index_merge_requests_on_milestone_id", using: :btree add_index "merge_requests", ["source_branch"], name: "index_merge_requests_on_source_branch", using: :btree add_index "merge_requests", ["source_project_id"], name: "index_merge_requests_on_source_project_id", using: :btree |