mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-7210: removed duplicated foreign key from async_job_join_map table
This commit is contained in:
parent
93c64cd7f2
commit
685a58a843
@ -60,6 +60,7 @@ public class Upgrade441to450 implements DbUpgrade {
|
||||
@Override
|
||||
public void performDataMigration(Connection conn) {
|
||||
dropInvalidKeyFromStoragePoolTable(conn);
|
||||
dropDuplicatedForeignKeyFromAsyncJobTable(conn);
|
||||
}
|
||||
|
||||
|
||||
@ -80,9 +81,22 @@ public class Upgrade441to450 implements DbUpgrade {
|
||||
keys.add("id_2");
|
||||
uniqueKeys.put("storage_pool", keys);
|
||||
|
||||
s_logger.debug("Droping id_2 key from storage_pool table");
|
||||
s_logger.debug("Dropping id_2 key from storage_pool table");
|
||||
for (Map.Entry<String, List<String>> entry: uniqueKeys.entrySet()) {
|
||||
DbUpgradeUtils.dropKeysIfExist(conn,entry.getKey(), entry.getValue(), false);
|
||||
}
|
||||
}
|
||||
|
||||
private void dropDuplicatedForeignKeyFromAsyncJobTable(Connection conn) {
|
||||
HashMap<String, List<String>> foreignKeys = new HashMap<String, List<String>>();
|
||||
List<String> keys = new ArrayList<String>();
|
||||
|
||||
keys.add("fk_async_job_join_map__join_job_id");
|
||||
foreignKeys.put("async_job_join_map", keys);
|
||||
|
||||
s_logger.debug("Dropping fk_async_job_join_map__join_job_id key from async_job_join_map table");
|
||||
for (Map.Entry<String, List<String>> entry: foreignKeys.entrySet()) {
|
||||
DbUpgradeUtils.dropKeysIfExist(conn,entry.getKey(), entry.getValue(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user