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

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

class AddNamespaceFkToAuditEventsHttpInstanceNamespaceFilters < Gitlab::Database::Migration[2.2]
  milestone '16.7'

  disable_ddl_transaction!

  def up
    add_concurrent_foreign_key :audit_events_streaming_http_instance_namespace_filters,
      :namespaces,
      column: :namespace_id,
      on_delete: :cascade
  end

  def down
    with_lock_retries do
      remove_foreign_key_if_exists :audit_events_streaming_http_instance_namespace_filters,
        column: :namespace_id
    end
  end
end