mirror of https://github.com/apache/cloudstack.git
accidently removed i_snapshots__removed stuff in 2.2.14 upgrade
compensate it back reviewed-by: alena
This commit is contained in:
parent
58865c60c2
commit
c1855075b3
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue