20170407140450_add_index_to_next_run_at_and_active.rb 477 Bytes
Newer Older
Kamil Trzcinski's avatar
Kamil Trzcinski committed
1 2 3
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.

4
class AddIndexToNextRunAtAndActive < ActiveRecord::Migration[4.2]
Kamil Trzcinski's avatar
Kamil Trzcinski committed
5 6 7 8
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

9 10 11 12 13 14 15
  disable_ddl_transaction!

  def up
    add_concurrent_index :ci_trigger_schedules, [:active, :next_run_at]
  end

  def down
Kamil Trzcinski's avatar
Kamil Trzcinski committed
16
    remove_concurrent_index :ci_trigger_schedules, [:active, :next_run_at]
Kamil Trzcinski's avatar
Kamil Trzcinski committed
17 18
  end
end