cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject git commit: updated refs/heads/4.4 to 5578616
Date Thu, 13 Nov 2014 19:01:55 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 9c0c4f713 -> 557861614


4.4.2 upgrade schema

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

Branch: refs/heads/4.4
Commit: 5578616143f2eb1aded26b86101c73858a67fa35
Parents: 9c0c4f7
Author: Daan Hoogland <daan@onecht.net>
Authored: Thu Nov 13 20:01:35 2014 +0100
Committer: Daan Hoogland <daan@onecht.net>
Committed: Thu Nov 13 20:01:35 2014 +0100

----------------------------------------------------------------------
 .../cloud/upgrade/DatabaseUpgradeChecker.java   | 45 ++++++--------
 .../com/cloud/upgrade/dao/Upgrade441to442.java  | 64 ++++++++++++++++++++
 2 files changed, 83 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/55786161/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
index b6e5543..e57b310 100755
--- a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
+++ b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
@@ -68,6 +68,7 @@ import com.cloud.upgrade.dao.Upgrade421to430;
 import com.cloud.upgrade.dao.Upgrade430to440;
 import com.cloud.upgrade.dao.Upgrade431to440;
 import com.cloud.upgrade.dao.Upgrade440to441;
+import com.cloud.upgrade.dao.Upgrade441to442;
 import com.cloud.upgrade.dao.UpgradeSnapshot217to224;
 import com.cloud.upgrade.dao.UpgradeSnapshot223to224;
 import com.cloud.upgrade.dao.VersionDao;
@@ -163,13 +164,9 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker
{
             new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441()});
 
         _upgradeMap.put("2.2.10", new DbUpgrade[] {new Upgrade2210to2211(), new Upgrade2211to2212(),
new Upgrade2212to2213(),
-            new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(),
new Upgrade302to40(), new Upgrade40to41(),
-            new Upgrade410to420(),
-            new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441()});
-
-        _upgradeMap.put("2.2.10", new DbUpgrade[] {new Upgrade2210to2211(), new Upgrade2211to2212(),
new Upgrade2212to2213(), new Upgrade2213to2214(),
-            new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to421(),
-            new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441()});
+            new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(),
new Upgrade302to40(),
+            new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(),
new Upgrade430to440(),
+            new Upgrade440to441()});
 
         _upgradeMap.put("2.2.12", new DbUpgrade[] {new Upgrade2212to2213(), new Upgrade2213to2214(),
new Upgrade2214to30(),
             new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(),
@@ -181,12 +178,6 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker
{
         _upgradeMap.put("2.2.14", new DbUpgrade[] {new Upgrade2214to30(), new Upgrade30to301(),
new Upgrade301to302(),
             new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to421(),
new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441()});
 
-        _upgradeMap.put("2.2.13", new DbUpgrade[] {new Upgrade2213to2214(), new Upgrade2214to30(),
new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
-            new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430()});
-
-        _upgradeMap.put("2.2.14", new DbUpgrade[] {new Upgrade2214to30(), new Upgrade30to301(),
new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(),
-            new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430()});
-
         _upgradeMap.put("3.0.0", new DbUpgrade[] {new Upgrade30to301(), new Upgrade301to302(),
new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(),
             new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441()});
 
@@ -196,35 +187,37 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker
{
         _upgradeMap.put("3.0.2", new DbUpgrade[] {new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(),
             new Upgrade430to440(), new Upgrade440to441()});
 
-        _upgradeMap.put("4.0.0", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441()});
+        _upgradeMap.put("4.0.0", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(),
new Upgrade441to442()});
+
+        _upgradeMap.put("4.0.1", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(),
new Upgrade441to442()});
 
-        _upgradeMap.put("4.0.1", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441()});
+        _upgradeMap.put("4.0.2", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(),
new Upgrade441to442()});
 
-        _upgradeMap.put("4.0.2", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441()});
+        _upgradeMap.put("4.1.0", new DbUpgrade[] {new Upgrade410to420(), new Upgrade420to421(),
new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442()});
 
-        _upgradeMap.put("4.1.0", new DbUpgrade[] {new Upgrade410to420(), new Upgrade420to421(),
new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441()});
+        _upgradeMap.put("4.1.1", new DbUpgrade[] {new Upgrade410to420(), new Upgrade420to421(),
new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442()});
 
-        _upgradeMap.put("4.1.1", new DbUpgrade[] {new Upgrade410to420(), new Upgrade420to421(),
new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441()});
+        _upgradeMap.put("4.2.0", new DbUpgrade[] {new Upgrade420to421(), new Upgrade421to430(),
new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to442()});
 
-        _upgradeMap.put("4.2.0", new DbUpgrade[] {new Upgrade420to421(), new Upgrade421to430(),
new Upgrade430to440(), new Upgrade440to441()});
+        _upgradeMap.put("4.2.1", new DbUpgrade[] {new Upgrade421to430(), new Upgrade430to440(),
new Upgrade440to441(), new Upgrade441to442()});
 
-        _upgradeMap.put("4.2.1", new DbUpgrade[] {new Upgrade421to430(), new Upgrade430to440(),
new Upgrade440to441()});
+        _upgradeMap.put("4.3.0", new DbUpgrade[] {new Upgrade430to440(), new Upgrade440to441(),
new Upgrade441to442()});
 
-        _upgradeMap.put("4.3.0", new DbUpgrade[] {new Upgrade430to440(), new Upgrade440to441()});
+        _upgradeMap.put("4.3.1", new DbUpgrade[] {new Upgrade431to440(), new Upgrade440to441(),
new Upgrade441to442()});
 
-        _upgradeMap.put("4.3.1", new DbUpgrade[] {new Upgrade431to440(), new Upgrade440to441()});
+        _upgradeMap.put("4.4.0", new DbUpgrade[] {new Upgrade440to441(), new Upgrade441to442()});
 
-        _upgradeMap.put("4.4.0", new DbUpgrade[] {new Upgrade440to441()});
+        _upgradeMap.put("4.4.1", new DbUpgrade[] {new Upgrade441to442()});
 
         //CP Upgrades
         _upgradeMap.put("3.0.3", new DbUpgrade[] {new Upgrade303to304(), new Upgrade304to305(),
new Upgrade305to306(), new Upgrade306to307(), new Upgrade307to410(),
-            new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(),
new Upgrade440to441(), new Upgrade440to441()});
+            new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(),
new Upgrade440to441()});
 
         _upgradeMap.put("3.0.4", new DbUpgrade[] {new Upgrade304to305(), new Upgrade305to306(),
new Upgrade306to307(), new Upgrade307to410(), new Upgrade410to420(),
-            new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(),
new Upgrade440to441()});
+            new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441()});
 
         _upgradeMap.put("3.0.5", new DbUpgrade[] {new Upgrade305to306(), new Upgrade306to307(),
new Upgrade307to410(), new Upgrade410to420(), new Upgrade420to421(),
-            new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade440to441()});
+            new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441()});
 
         _upgradeMap.put("3.0.6", new DbUpgrade[] {new Upgrade306to307(), new Upgrade307to410(),
new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(),
             new Upgrade430to440(), new Upgrade440to441()});

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/55786161/engine/schema/src/com/cloud/upgrade/dao/Upgrade441to442.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade441to442.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade441to442.java
new file mode 100644
index 0000000..bd50dfb
--- /dev/null
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade441to442.java
@@ -0,0 +1,64 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package com.cloud.upgrade.dao;
+
+import java.io.File;
+import java.sql.Connection;
+
+import org.apache.log4j.Logger;
+
+import com.cloud.utils.exception.CloudRuntimeException;
+import com.cloud.utils.script.Script;
+
+public class Upgrade441to442 implements DbUpgrade {
+    final static Logger s_logger = Logger.getLogger(Upgrade441to442.class);
+
+    @Override
+    public String[] getUpgradableVersionRange() {
+        return new String[] {"4.4.1", "4.4.2"};
+    }
+
+    @Override
+    public String getUpgradedVersion() {
+        return "4.4.2";
+    }
+
+    @Override
+    public boolean supportsRollingUpgrade() {
+        return false;
+    }
+
+    @Override
+    public File[] getPrepareScripts() {
+        String script = Script.findScript("", "db/schema-441to442.sql");
+        if (script == null) {
+            throw new CloudRuntimeException("Unable to find db/schema-441to442.sql");
+        }
+
+        return new File[] {new File(script)};
+    }
+
+    @Override
+    public void performDataMigration(Connection conn) {
+    }
+
+    @Override
+    public File[] getCleanupScripts() {
+        return null;
+    }
+}


Mime
View raw message