Bug 12292: updated netapp_volume primary key for upgrades

Status 12292: resolved fixed
Reviewed-By: Nitin
This commit is contained in:
kishan 2012-01-18 14:04:40 +05:30
parent a068475dcb
commit 847b5bc983
1 changed files with 10 additions and 0 deletions

View File

@ -80,5 +80,15 @@ public class Upgrade2213to2214 implements DbUpgrade {
} catch (SQLException e) {
throw new CloudRuntimeException("Unable to execute usage_event table update", e);
}
//Drop netapp_volume primary key and add it again
DbUpgradeUtils.dropPrimaryKeyIfExists(conn, "cloud.netapp_volume");
try {
PreparedStatement pstmt = conn.prepareStatement("ALTER TABLE `cloud`.`netapp_volume` add PRIMARY KEY (`id`)");
pstmt.executeUpdate();
pstmt.close();
} catch (SQLException e) {
throw new CloudRuntimeException("Unable to update primary key for netapp_volume", e);
}
}
}