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

20200504200709_add_index_on_fingerprint_and_target_type_to_events.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9b06d5933007d33ab0e36fc4b6f8ad53b1c81cff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class AddIndexOnFingerprintAndTargetTypeToEvents < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  KEYS = [:target_type, :target_id, :fingerprint]

  def up
    add_concurrent_index :events, KEYS, using: :btree, unique: true
  end

  def down
    remove_concurrent_index :events, KEYS
  end
end