From f11fdcfb984a71c0778a19c683f7cc6d8f448fe0 Mon Sep 17 00:00:00 2001
From: Andreas Svanberg <andreass@dsv.su.se>
Date: Mon, 11 Nov 2024 15:44:11 +0100
Subject: [PATCH] Fix foreign key names

The names in production are somehow different from what the migrations say they should be. The production database has been manually corrected to match the names in the migration scripts.
---
 .../V390__harmonize_table_attribute_name.sql         | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/core/src/main/resources/db/migration/V390__harmonize_table_attribute_name.sql b/core/src/main/resources/db/migration/V390__harmonize_table_attribute_name.sql
index 7911d7496f..ad61842df7 100644
--- a/core/src/main/resources/db/migration/V390__harmonize_table_attribute_name.sql
+++ b/core/src/main/resources/db/migration/V390__harmonize_table_attribute_name.sql
@@ -909,7 +909,7 @@ alter table `checklist_template_project_type`
 
 -- table: milestone_activity_template_ProjectType, except foreign key to coming table project_type
 
-alter table `milestone_activity_template_ProjectType` drop foreign key `milestone_activity_template_ProjectType_ibfk_1`;
+alter table `milestone_activity_template_ProjectType` drop foreign key `FKFB3FC75180E42A0F`;
 alter table `milestone_activity_template_ProjectType` drop foreign key `FKFB3FC75157F6B071`;
 alter table `milestone_activity_template_ProjectType` drop key `FKFB3FC75180E42A0F`;
 alter table `milestone_activity_template_ProjectType` drop key `FKFB3FC75157F6B071`;
@@ -1823,7 +1823,7 @@ alter table `activity_thread`
 
 -- table: project_first_meeting, except foreign key to becoming table activity
 
-alter table `project_first_meeting` drop foreign key `project_first_meeting_ibfk_1`;
+alter table `project_first_meeting` drop foreign key `FK_project_first_meeting_activity`;
 
 alter table `project_first_meeting` drop key `FK_project_first_meeting_activity`;
 
@@ -2715,7 +2715,7 @@ alter table `final_thesis`
 
 -- table: project_file
 
-alter table `project_file` drop foreign key project_file_ibfk_2;
+alter table `project_file` drop foreign key FK_project_file_project;
 alter table `project_file` drop foreign key FK_project_file_file;
 
 alter table `project_file` drop key FK_project_file_file;
@@ -2805,7 +2805,7 @@ alter table `decision`
 
 -- table: urkund_submission
 
-alter table `urkund_submission` drop foreign key `urkund_submission_ibfk_2`;
+alter table `urkund_submission` drop foreign key `FK_urkund_submission_receiver`;
 alter table `urkund_submission` drop foreign key `FK_urkund_submission_document_reference`;
 
 alter table `urkund_submission` drop key `FK_urkund_submission_document_reference`;
@@ -2831,7 +2831,7 @@ alter table `urkund_submission`
 
 -- table: plagiarism_request
 
-alter table `plagiarism_request` drop foreign key `plagiarism_request_ibfk_2`;
+alter table `plagiarism_request` drop foreign key `FK_plagiarism_request_receiver`;
 alter table `plagiarism_request` drop foreign key `FK_plagiarism_request_document_reference`;
 
 alter table `plagiarism_request` drop key `FK_plagiarism_request_document_reference`;
@@ -3151,7 +3151,7 @@ alter table `NotificationData` drop foreign key `FK2DCAC3558D40D1B9`;
 alter table `NotificationData` drop foreign key `FK2DCAC3554D07E0A9`;
 
 alter table `NotificationData` drop key `FK_notification_data_group`;
-alter table `NotificationData` drop key `FK_sqjaj3jb6t9lsw1l2p8ex8jnb`;
+alter table `NotificationData` drop key `FK_notification_data_milestone`;
 alter table `NotificationData` drop key `FK2DCAC355FCDADF61`;
 alter table `NotificationData` drop key `FK2DCAC355B2E2AD78`;
 alter table `NotificationData` drop key `FK2DCAC3558D40D1B9`;