cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kous...@apache.org
Subject [32/50] [abbrv] git commit: refs/heads/cisco-vnmc-api-integration - CLOUDSTACK-1380: add db upgrade for vm_template, in 4.1 to 4.2 upgrade procedure
Date Wed, 13 Mar 2013 06:25:04 GMT
CLOUDSTACK-1380: add db upgrade for vm_template, in 4.1 to 4.2 upgrade procedure


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/310e9908
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/310e9908
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/310e9908

Branch: refs/heads/cisco-vnmc-api-integration
Commit: 310e99087ff8f46ac903f2a28169f3ffe2d13ebd
Parents: c30da35
Author: Edison Su <sudison@gmail.com>
Authored: Mon Feb 25 10:45:04 2013 -0800
Committer: Edison Su <sudison@gmail.com>
Committed: Mon Feb 25 10:45:04 2013 -0800

----------------------------------------------------------------------
 .../src/com/cloud/upgrade/dao/Upgrade410to420.java |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/310e9908/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/upgrade/dao/Upgrade410to420.java b/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
index a059257..9000e15 100644
--- a/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
+++ b/server/src/com/cloud/upgrade/dao/Upgrade410to420.java
@@ -59,6 +59,20 @@ public class Upgrade410to420 implements DbUpgrade {
 
 	@Override
 	public void performDataMigration(Connection conn) {
+	    PreparedStatement sql = null;
+	    try {
+	        sql = conn.prepareStatement("update vm_template set image_data_store_id = 1 where
type = 'SYSTEM' or type = 'BUILTIN'");
+	        sql.executeUpdate();
+        } catch (SQLException e) {
+            throw new CloudRuntimeException("Failed to upgrade vm template data store uuid:
" + e.toString());
+        } finally {
+            if (sql != null) {
+                try {
+                    sql.close();
+                } catch (SQLException e) {
+                }
+            }
+        }
 	}
 
 	@Override


Mime
View raw message