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

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

class AddInvalidForeignKeyFromChatNameToService < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers
  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_foreign_key :chat_names, :services, column: :service_id, on_delete: :cascade, validate: false
  end

  def down
    remove_foreign_key_if_exists :chat_names, column: :service_id
  end
end