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>2020-03-05 21:08:19 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-05 21:08:19 +0300
commita8de96bff51846e160b76506dc0ca0fe6f767f64 (patch)
tree1036f1ca75aba492eaaa3439c84a3109b4684896 /db/migrate/20200226100624_requirements_add_project_fk.rb
parentafe2b984524ae4b0c8a0636db7ec5b2c452f0734 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate/20200226100624_requirements_add_project_fk.rb')
-rw-r--r--db/migrate/20200226100624_requirements_add_project_fk.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20200226100624_requirements_add_project_fk.rb b/db/migrate/20200226100624_requirements_add_project_fk.rb
new file mode 100644
index 00000000000..7c133e820f3
--- /dev/null
+++ b/db/migrate/20200226100624_requirements_add_project_fk.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class RequirementsAddProjectFk < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def up
+ with_lock_retries do
+ add_foreign_key(:requirements, :projects, column: :project_id, on_delete: :cascade) # rubocop: disable Migration/AddConcurrentForeignKey
+ end
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key(:requirements, column: :project_id)
+ end
+ end
+end