summaryrefslogtreecommitdiff
path: root/db/post_migrate/20211206073851_create_calendar_events_index_synchronously.rb
blob: 020dceac0049093ebb0357eb603e8bc226af5be0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class CreateCalendarEventsIndexSynchronously < Gitlab::Database::Migration[1.0]
  disable_ddl_transaction!

  INDEX_NAME = 'index_events_author_id_project_id_action_target_type_created_at'

  def up
    add_concurrent_index :events, [:author_id, :project_id, :action, :target_type, :created_at], name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name :events, INDEX_NAME
  end
end