diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 09:45:46 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 09:45:46 +0000 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /db/post_migrate/20220119143130_remove_projects_ci_sources_pipelines_source_project_id_fk.rb | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) | |
download | gitlab-ce-a7b3560714b4d9cc4ab32dffcd1f74a284b93580.tar.gz |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'db/post_migrate/20220119143130_remove_projects_ci_sources_pipelines_source_project_id_fk.rb')
-rw-r--r-- | db/post_migrate/20220119143130_remove_projects_ci_sources_pipelines_source_project_id_fk.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/db/post_migrate/20220119143130_remove_projects_ci_sources_pipelines_source_project_id_fk.rb b/db/post_migrate/20220119143130_remove_projects_ci_sources_pipelines_source_project_id_fk.rb new file mode 100644 index 00000000000..7fe9f1c856b --- /dev/null +++ b/db/post_migrate/20220119143130_remove_projects_ci_sources_pipelines_source_project_id_fk.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveProjectsCiSourcesPipelinesSourceProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + execute('LOCK projects, ci_sources_pipelines IN ACCESS EXCLUSIVE MODE') + + remove_foreign_key_if_exists(:ci_sources_pipelines, :projects, name: "fk_acd9737679") + end + end + + def down + add_concurrent_foreign_key(:ci_sources_pipelines, :projects, name: "fk_acd9737679", column: :source_project_id, target_column: :id, on_delete: :cascade) + end +end |