diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-20 21:09:31 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-20 21:09:31 +0300 |
commit | ae4ef81757bdd2c984777d8f0b2c275bbcb4b17d (patch) | |
tree | 1ac23c80190bafb47a1f5a6f1aae9da91d35d9dc /db/migrate/20200316173312_add_vulnerability_export_project_foreign_key.rb | |
parent | 194b499aa8e26df26ff70a1e1ce0396587bd5243 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate/20200316173312_add_vulnerability_export_project_foreign_key.rb')
-rw-r--r-- | db/migrate/20200316173312_add_vulnerability_export_project_foreign_key.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20200316173312_add_vulnerability_export_project_foreign_key.rb b/db/migrate/20200316173312_add_vulnerability_export_project_foreign_key.rb new file mode 100644 index 00000000000..23837f559d2 --- /dev/null +++ b/db/migrate/20200316173312_add_vulnerability_export_project_foreign_key.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddVulnerabilityExportProjectForeignKey < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + with_lock_retries do + add_foreign_key :vulnerability_exports, :projects, column: :project_id, on_delete: :cascade, index: false # rubocop:disable Migration/AddConcurrentForeignKey + end + end + + def down + with_lock_retries do + remove_foreign_key :vulnerability_exports, column: :project_id + end + end +end |