summaryrefslogtreecommitdiff
path: root/db/post_migrate/20220112230642_remove_projects_ci_unit_tests_project_id_fk.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/post_migrate/20220112230642_remove_projects_ci_unit_tests_project_id_fk.rb')
-rw-r--r--db/post_migrate/20220112230642_remove_projects_ci_unit_tests_project_id_fk.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/db/post_migrate/20220112230642_remove_projects_ci_unit_tests_project_id_fk.rb b/db/post_migrate/20220112230642_remove_projects_ci_unit_tests_project_id_fk.rb
new file mode 100644
index 00000000000..9ad90a3a7a0
--- /dev/null
+++ b/db/post_migrate/20220112230642_remove_projects_ci_unit_tests_project_id_fk.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class RemoveProjectsCiUnitTestsProjectIdFk < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(:ci_unit_tests, :projects, name: "fk_7a8fabf0a8")
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:ci_unit_tests, :projects, name: "fk_7a8fabf0a8", column: :project_id, target_column: :id, on_delete: "cascade")
+ end
+end