summaryrefslogtreecommitdiff
path: root/db/migrate/20200406141452_add_index_to_issue_id_and_created_at_on_resource_weight_events.rb
blob: 94a1b589ff931e9fa1ee09574960c1048792c1b6 (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 AddIndexToIssueIdAndCreatedAtOnResourceWeightEvents < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  INDEX_NAME = 'index_resource_weight_events_on_issue_id_and_created_at'

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_index :resource_weight_events, [:issue_id, :created_at], name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name :resource_weight_events, INDEX_NAME
  end
end