From 152dfe4fd2c34c772c799a41fa5fa98a01369035 Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Wed, 29 Feb 2012 16:26:23 -0800 Subject: [PATCH] More fixes to the db upgrade --- server/src/com/cloud/upgrade/dao/Upgrade2214to30.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/src/com/cloud/upgrade/dao/Upgrade2214to30.java b/server/src/com/cloud/upgrade/dao/Upgrade2214to30.java index 556ecf380e4..809c42e0f0a 100644 --- a/server/src/com/cloud/upgrade/dao/Upgrade2214to30.java +++ b/server/src/com/cloud/upgrade/dao/Upgrade2214to30.java @@ -793,6 +793,16 @@ public class Upgrade2214to30 implements DbUpgrade { ResultSet rs = null; ResultSet rs1 = null; try { + //check if switch_to_isolated is present; if not - skip this part of the code + try { + pstmt = conn + .prepareStatement("select switch_to_isolated from `cloud`.`networks`"); + rs = pstmt.executeQuery(); + } catch (Exception ex) { + s_logger.debug("switch_to_isolated field is not present in networks table"); + return ; + } + // get all networks that need to be updated to the redundant network offerings pstmt = conn .prepareStatement("select id, network_offering_id from `cloud`.`networks` where switch_to_isolated=1");