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

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

class AddFkOnSentNotificationsToIssueEmailParticipants < Gitlab::Database::Migration[2.2]
  disable_ddl_transaction!

  milestone '16.9'

  def up
    add_concurrent_foreign_key(
      :sent_notifications,
      :issue_email_participants,
      column: :issue_email_participant_id,
      on_delete: :nullify,
      validate: false
    )
  end

  def down
    with_lock_retries do
      remove_foreign_key_if_exists :sent_notifications, column: :issue_email_participant_id
    end
  end
end