Commit 090f4d1f authored by Adam Hegyi's avatar Adam Hegyi

Merge branch 'dblessing-disable-tx-on-delete' into 'master'

Disable transactions for user foreign key migrations

See merge request gitlab-org/gitlab!29704
parents 0c02c15c c24c2e8a
# frozen_string_literal: true
# rubocop: disable Migration/AddConcurrentForeignKey
# rubocop: disable Migration/WithLockRetriesWithoutDdlTransaction
class AddProtectedTagCreateAccessLevelsUserIdForeignKey < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
CONSTRAINT_NAME = 'fk_protected_tag_create_access_levels_user_id'
disable_ddl_transaction!
def up
with_lock_retries do
add_foreign_key(:protected_tag_create_access_levels, :users, on_delete: :cascade, validate: false, name: CONSTRAINT_NAME)
......
# frozen_string_literal: true
# rubocop: disable Migration/AddConcurrentForeignKey
# rubocop: disable Migration/WithLockRetriesWithoutDdlTransaction
class AddProtectedBranchMergeAccessLevelsUserIdForeignKey < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
CONSTRAINT_NAME = 'fk_protected_branch_merge_access_levels_user_id'
disable_ddl_transaction!
def up
with_lock_retries do
add_foreign_key(:protected_branch_merge_access_levels, :users, on_delete: :cascade, validate: false, name: CONSTRAINT_NAME)
......
# frozen_string_literal: true
# rubocop: disable Migration/AddConcurrentForeignKey
# rubocop: disable Migration/WithLockRetriesWithoutDdlTransaction
class AddPathLocksUserIdForeignKey < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
CONSTRAINT_NAME = 'fk_path_locks_user_id'
disable_ddl_transaction!
def up
with_lock_retries do
add_foreign_key(:path_locks, :users, on_delete: :cascade, validate: false, name: CONSTRAINT_NAME)
......
# frozen_string_literal: true
# rubocop: disable Migration/AddConcurrentForeignKey
# rubocop: disable Migration/WithLockRetriesWithoutDdlTransaction
class AddProtectedBranchPushAccessLevelsUserIdForeignKey < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
CONSTRAINT_NAME = 'fk_protected_branch_push_access_levels_user_id'
disable_ddl_transaction!
def up
with_lock_retries do
add_foreign_key(:protected_branch_push_access_levels, :users, on_delete: :cascade, validate: false, name: CONSTRAINT_NAME)
......
# frozen_string_literal: true
# rubocop: disable Migration/AddConcurrentForeignKey
# rubocop: disable Migration/WithLockRetriesWithoutDdlTransaction
class AddU2fRegistrationsUserIdForeignKey < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
CONSTRAINT_NAME = 'fk_u2f_registrations_user_id'
disable_ddl_transaction!
def up
with_lock_retries do
add_foreign_key(:u2f_registrations, :users, on_delete: :cascade, validate: false, name: CONSTRAINT_NAME)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment