@@ -60,6 +60,7 @@ public File[] getPrepareScripts() {
6060 @ Override
6161 public void performDataMigration (Connection conn ) {
6262 dropInvalidKeyFromStoragePoolTable (conn );
63+ dropDuplicatedForeignKeyFromAsyncJobTable (conn );
6364 }
6465
6566
@@ -80,9 +81,22 @@ private void dropInvalidKeyFromStoragePoolTable(Connection conn) {
8081 keys .add ("id_2" );
8182 uniqueKeys .put ("storage_pool" , keys );
8283
83- s_logger .debug ("Droping id_2 key from storage_pool table" );
84+ s_logger .debug ("Dropping id_2 key from storage_pool table" );
8485 for (Map .Entry <String , List <String >> entry : uniqueKeys .entrySet ()) {
8586 DbUpgradeUtils .dropKeysIfExist (conn ,entry .getKey (), entry .getValue (), false );
8687 }
8788 }
89+
90+ private void dropDuplicatedForeignKeyFromAsyncJobTable (Connection conn ) {
91+ HashMap <String , List <String >> foreignKeys = new HashMap <String , List <String >>();
92+ List <String > keys = new ArrayList <String >();
93+
94+ keys .add ("fk_async_job_join_map__join_job_id" );
95+ foreignKeys .put ("async_job_join_map" , keys );
96+
97+ s_logger .debug ("Dropping fk_async_job_join_map__join_job_id key from async_job_join_map table" );
98+ for (Map .Entry <String , List <String >> entry : foreignKeys .entrySet ()) {
99+ DbUpgradeUtils .dropKeysIfExist (conn ,entry .getKey (), entry .getValue (), true );
100+ }
101+ }
88102}
0 commit comments