summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorHiroyuki Sato <sathiroyuki@gmail.com>2018-01-12 20:38:36 +0000
committerClement Ho <clemmakesapps@gmail.com>2018-01-12 20:38:36 +0000
commita7d26f00c35b945199d40332349f463043ae6122 (patch)
tree7b76a2e305e4a4f81f61271337c9731d0d50e16f /db
parent1b5f179557d03683f92ed3af3d357df056cc8ece (diff)
downloadgitlab-ce-a7d26f00c35b945199d40332349f463043ae6122.tar.gz
Display related merge requests in commit detail page
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20170827123848_add_index_on_merge_request_diff_commit_sha.rb17
-rw-r--r--db/schema.rb1
2 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20170827123848_add_index_on_merge_request_diff_commit_sha.rb b/db/migrate/20170827123848_add_index_on_merge_request_diff_commit_sha.rb
new file mode 100644
index 00000000000..1b360b231a8
--- /dev/null
+++ b/db/migrate/20170827123848_add_index_on_merge_request_diff_commit_sha.rb
@@ -0,0 +1,17 @@
+# rubocop:disable RemoveIndex
+
+class AddIndexOnMergeRequestDiffCommitSha < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :merge_request_diff_commits, :sha, length: Gitlab::Database.mysql? ? 20 : nil
+ end
+
+ def down
+ remove_index :merge_request_diff_commits, :sha if index_exists? :merge_request_diff_commits, :sha
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 8a6db61250b..f47accca21a 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1013,6 +1013,7 @@ ActiveRecord::Schema.define(version: 20180105212544) do
end
add_index "merge_request_diff_commits", ["merge_request_diff_id", "relative_order"], name: "index_merge_request_diff_commits_on_mr_diff_id_and_order", unique: true, using: :btree
+ add_index "merge_request_diff_commits", ["sha"], name: "index_merge_request_diff_commits_on_sha", using: :btree
create_table "merge_request_diff_files", id: false, force: :cascade do |t|
t.integer "merge_request_diff_id", null: false