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

20191216074800_add_epic_date_sourcing_milestone_indexes.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 72fd593733193637c8e400dbb89f68927559f80f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

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

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_index :epics, due_date_column
    add_concurrent_index :epics, start_date_column
  end

  def down
    remove_concurrent_index :epics, start_date_column
    remove_concurrent_index :epics, due_date_column
  end

  private

  def due_date_column
    :due_date_sourcing_milestone_id
  end

  def start_date_column
    :start_date_sourcing_milestone_id
  end
end