From 38dd1d6ea9a99b2ed75a2e693b454731c9bf6d00 Mon Sep 17 00:00:00 2001 From: Alex Huang Date: Thu, 14 Apr 2011 03:17:55 -0700 Subject: [PATCH] bug 9422: added rows in op_networks table to correspond to the rows in networks table --- server/src/com/cloud/upgrade/dao/Upgrade218to22.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/upgrade/dao/Upgrade218to22.java b/server/src/com/cloud/upgrade/dao/Upgrade218to22.java index 61ccfc973be..832b5aeea99 100644 --- a/server/src/com/cloud/upgrade/dao/Upgrade218to22.java +++ b/server/src/com/cloud/upgrade/dao/Upgrade218to22.java @@ -552,12 +552,20 @@ public class Upgrade218to22 implements DbUpgrade { pstmt.setString(i++, reservationId); pstmt.setString(i++, broadcastUri); pstmt.executeUpdate(); - + + pstmt = conn.prepareStatement("INSERT INTO op_networks(id, mac_address_seq, nics_count, gc, check_for_gc) VALUES(?, ?, ?, ?, ?)"); + pstmt.setLong(1, seq); + pstmt.setLong(2, 0); + pstmt.setLong(3, 1); + pstmt.setLong(4, 0); + pstmt.setBoolean(5, true); + pstmt.executeUpdate(); + pstmt = conn.prepareStatement("INSERT INTO account_network_ref (account_id, network_id, is_owner) VALUES (?, ?, 1)"); pstmt.setLong(1, accountId); pstmt.setLong(2, seq); pstmt.executeUpdate(); - + return seq; } catch (SQLException e) { throw new CloudRuntimeException("Unable to create network", e);