diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java index 6e8811045f4..f9ec6e4b80d 100644 --- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java +++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java @@ -1760,9 +1760,9 @@ public class Upgrade410to420 implements DbUpgrade { PreparedStatement pstmtSelectSwiftCount = conn.prepareStatement(sqlSelectSwiftCount); PreparedStatement storeDetailInsert = conn.prepareStatement(sqlInsertStoreDetail); PreparedStatement storeInsert = - conn.prepareStatement("INSERT INTO `cloud`.`image_store` (id, uuid, name, image_provider_name, protocol, url, data_center_id, scope, role, parent, total_size, created) values(?, ?, ?, 'NFS', 'nfs', ?, ?, 'ZONE', ?, ?, ?, ?)"); + conn.prepareStatement("INSERT INTO `cloud`.`image_store` (id, uuid, name, image_provider_name, protocol, url, data_center_id, scope, role, parent, total_size, created, removed) values(?, ?, ?, 'NFS', 'nfs', ?, ?, 'ZONE', ?, ?, ?, ?, ?)"); PreparedStatement nfsQuery = - conn.prepareStatement("select id, uuid, url, data_center_id, parent, total_size, created from `cloud`.`host` where type = 'SecondaryStorage' and removed is null"); + conn.prepareStatement("select id, uuid, url, data_center_id, parent, total_size, created, removed from `cloud`.`host` where type = 'SecondaryStorage'"); PreparedStatement pstmtUpdateHostAsRemoved = conn.prepareStatement(sqlUpdateHostAsRemoved); ResultSet rsSelectS3Count = pstmtSelectS3Count.executeQuery(); ResultSet rsSelectSwiftCount = pstmtSelectSwiftCount.executeQuery(); @@ -1797,6 +1797,7 @@ public class Upgrade410to420 implements DbUpgrade { int nfs_dcid = rsNfs.getInt("data_center_id"); Long nfs_totalsize = rsNfs.getObject("total_size") != null ? rsNfs.getLong("total_size") : null; Date nfs_created = rsNfs.getDate("created"); + Date nfs_removed = rsNfs.getDate("removed"); // insert entry in image_store table and image_store_details // table and store host_id and store_id mapping @@ -1813,6 +1814,7 @@ public class Upgrade410to420 implements DbUpgrade { storeInsert.setNull(8, Types.BIGINT); } storeInsert.setDate(9, nfs_created); + storeInsert.setDate(10, nfs_removed); storeInsert.executeUpdate(); }