Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20170827123848_add_index_on_merge_request_diff_commit_sha.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e2061b5600acf88cb5d741a652ec35e886252237 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# rubocop:disable RemoveIndex

class AddIndexOnMergeRequestDiffCommitSha < ActiveRecord::Migration[4.2]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_index :merge_request_diff_commits, :sha, length: mysql_compatible_index_length
  end

  def down
    remove_index :merge_request_diff_commits, :sha if index_exists? :merge_request_diff_commits, :sha
  end
end