summaryrefslogtreecommitdiff
path: root/db/migrate/20200121194048_add_geo_event_id_index_to_geo_event_log.rb
blob: 9b0ec12c959baabbd980bcf2acbcac67a442a592 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

class AddGeoEventIdIndexToGeoEventLog < ActiveRecord::Migration[5.2]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_index :geo_event_log, :geo_event_id,
                         where: "(geo_event_id IS NOT NULL)",
                         using: :btree,
                         name: 'index_geo_event_log_on_geo_event_id'
  end

  def down
    remove_concurrent_index :geo_event_log, :geo_event_id, name: 'index_geo_event_log_on_geo_event_id'
  end
end