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:
Diffstat (limited to 'db/migrate/20231003073526_add_notes_foreign_key_to_abuse_report_user_mentions.rb')
-rw-r--r--db/migrate/20231003073526_add_notes_foreign_key_to_abuse_report_user_mentions.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/20231003073526_add_notes_foreign_key_to_abuse_report_user_mentions.rb b/db/migrate/20231003073526_add_notes_foreign_key_to_abuse_report_user_mentions.rb
new file mode 100644
index 00000000000..0fc8b2cdcfb
--- /dev/null
+++ b/db/migrate/20231003073526_add_notes_foreign_key_to_abuse_report_user_mentions.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddNotesForeignKeyToAbuseReportUserMentions < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :abuse_report_user_mentions, :notes, column: :note_id, on_delete: :cascade
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key :abuse_report_user_mentions, column: :note_id
+ end
+ end
+end