From c1855075b34806220237f502f219906b73d2c413 Mon Sep 17 00:00:00 2001 From: frank Date: Thu, 2 Feb 2012 17:03:28 -0800 Subject: [PATCH] accidently removed i_snapshots__removed stuff in 2.2.14 upgrade compensate it back reviewed-by: alena --- .../src/com/cloud/upgrade/dao/Upgrade2213to2214.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/src/com/cloud/upgrade/dao/Upgrade2213to2214.java b/server/src/com/cloud/upgrade/dao/Upgrade2213to2214.java index 2060c902e5d..9f36a296e1f 100755 --- a/server/src/com/cloud/upgrade/dao/Upgrade2213to2214.java +++ b/server/src/com/cloud/upgrade/dao/Upgrade2213to2214.java @@ -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(); + 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 {