diff options
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20170827123848_add_index_on_merge_request_diff_commit_sha.rb | 17 |
1 files changed, 17 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 |