diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-16 13:42:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-16 13:42:19 +0300 |
commit | 84d1bd786125c1c14a3ba5f63e38a4cc736a9027 (patch) | |
tree | f550fa965f507077e20dbb6d61a8269a99ef7107 /db/post_migrate/20231220150210_remove_users_organization_users_user_id_fk.rb | |
parent | 3a105e36e689f7b75482236712f1a47fd5a76814 (diff) |
Add latest changes from gitlab-org/gitlab@16-8-stable-eev16.8.0-rc42
Diffstat (limited to 'db/post_migrate/20231220150210_remove_users_organization_users_user_id_fk.rb')
-rw-r--r-- | db/post_migrate/20231220150210_remove_users_organization_users_user_id_fk.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/db/post_migrate/20231220150210_remove_users_organization_users_user_id_fk.rb b/db/post_migrate/20231220150210_remove_users_organization_users_user_id_fk.rb new file mode 100644 index 00000000000..365d6b0fc77 --- /dev/null +++ b/db/post_migrate/20231220150210_remove_users_organization_users_user_id_fk.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class RemoveUsersOrganizationUsersUserIdFk < Gitlab::Database::Migration[2.2] + milestone '16.8' + disable_ddl_transaction! + + FOREIGN_KEY_NAME = "fk_8d9b20725d" + + def up + with_lock_retries do + remove_foreign_key_if_exists(:organization_users, :users, + name: FOREIGN_KEY_NAME, reverse_lock_order: true) + end + end + + def down + add_concurrent_foreign_key(:organization_users, :users, + name: FOREIGN_KEY_NAME, column: :user_id, + target_column: :id, on_delete: :cascade) + end +end |