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

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

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

  DOWNTIME = false
  INDEX_NAME = 'index_audit_events_on_ruby_object_in_details'

  disable_ddl_transaction!

  def up
    remove_concurrent_index_by_name(:audit_events, INDEX_NAME)
  end

  def down
    add_concurrent_index(:audit_events, :id, where: "details ~~ '%ruby/object%'", name: INDEX_NAME)
  end
end