CLOUDSTACK-4661:[DB Upgrade] SecondaryStorage entry in host table before

upgrade is not marked as removed after migrating them to image_store
table.
This commit is contained in:
Min Chen 2013-09-12 18:52:40 -07:00
parent bc98bca7f2
commit 1042136c23
1 changed files with 5 additions and 0 deletions

View File

@ -2197,6 +2197,11 @@ public class Upgrade410to420 implements DbUpgrade {
storeInsert.setDate(9, nfs_created);
storeInsert.executeUpdate();
}
s_logger.debug("Marking NFS secondary storage in host table as removed");
pstmt = conn.prepareStatement("UPDATE `cloud`.`host` SET removed = now() WHERE type = 'SecondaryStorage' and removed is null");
pstmt.executeUpdate();
pstmt.close();
}
catch (SQLException e) {
String msg = "Unable to migrate secondary storages." + e.getMessage();