More fixes to the db upgrade

This commit is contained in:
Alena Prokharchyk 2012-02-29 16:26:23 -08:00
parent e6d43e157e
commit 152dfe4fd2
1 changed files with 10 additions and 0 deletions

View File

@ -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");