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

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

class CreateIndexAlertManagementAlertsOnCreatedAtProjectIdWithIssue < Gitlab::Database::Migration[2.1]
  INDEX_NAME = 'idx_alert_management_alerts_on_created_at_project_id_with_issue'

  disable_ddl_transaction!

  def up
    add_concurrent_index :alert_management_alerts, [:created_at, :project_id],
      where: 'issue_id IS NOT NULL',
      name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name :alert_management_alerts, INDEX_NAME
  end
end