accidently removed i_snapshots__removed stuff in 2.2.14 upgrade

compensate it back

reviewed-by: alena
This commit is contained in:
frank 2012-02-02 17:03:28 -08:00
parent 58865c60c2
commit c1855075b3
1 changed files with 12 additions and 0 deletions

View File

@ -117,6 +117,18 @@ public class Upgrade2213to2214 implements DbUpgrade {
throw new CloudRuntimeException("Unable to execute cloud_usage usage_event table update", e);
}
//Drop i_snapshots__removed key (if exists) and re-add it again
keys = new ArrayList<String>();
keys.add("i_snapshots__removed");
DbUpgradeUtils.dropKeysIfExist(conn, "cloud.snapshots", keys, false);
try {
PreparedStatement pstmt = conn.prepareStatement("ALTER TABLE `cloud`.`snapshots` ADD INDEX `i_snapshots__removed`(`removed`)");
pstmt.executeUpdate();
pstmt.close();
} catch (SQLException e) {
throw new CloudRuntimeException("Unable to insert index for removed column in snapshots", e);
}
//Drop netapp_volume primary key and add it again
DbUpgradeUtils.dropPrimaryKeyIfExists(conn, "cloud.netapp_volume");
try {