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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-12-22 12:17:04 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-12-22 12:17:04 +0300
commit6b0293c14dce817f72310127dd38562313321b1b (patch)
treecb2254757b496664957a2b5d90c21d7d76e4bdeb /db/post_migrate
parent968a9dd39b77628b541e0788488bad2493fefbee (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/post_migrate')
-rw-r--r--db/post_migrate/20231220150143_remove_organizations_organization_users_organization_id_fk.rb21
-rw-r--r--db/post_migrate/20231220150210_remove_users_organization_users_user_id_fk.rb21
2 files changed, 42 insertions, 0 deletions
diff --git a/db/post_migrate/20231220150143_remove_organizations_organization_users_organization_id_fk.rb b/db/post_migrate/20231220150143_remove_organizations_organization_users_organization_id_fk.rb
new file mode 100644
index 00000000000..75bf5d3ead9
--- /dev/null
+++ b/db/post_migrate/20231220150143_remove_organizations_organization_users_organization_id_fk.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class RemoveOrganizationsOrganizationUsersOrganizationIdFk < Gitlab::Database::Migration[2.2]
+ milestone '16.8'
+ disable_ddl_transaction!
+
+ FOREIGN_KEY_NAME = "fk_8471abad75"
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(:organization_users, :organizations,
+ name: FOREIGN_KEY_NAME, reverse_lock_order: true)
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:organization_users, :organizations,
+ name: FOREIGN_KEY_NAME, column: :organization_id,
+ target_column: :id, on_delete: :cascade)
+ end
+end
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