cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weiz...@apache.org
Subject git commit: updated refs/heads/master to 0529da1
Date Fri, 02 Aug 2013 09:51:44 GMT
Updated Branches:
  refs/heads/master 68f194b14 -> 0529da136


upgrade: Add upgrade patch to 4.3.0


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

Branch: refs/heads/master
Commit: 0529da136ffe1c1316fca4313dd2106de6f57d6c
Parents: 68f194b
Author: Wei Zhou <w.zhou@leaseweb.com>
Authored: Fri Aug 2 11:50:19 2013 +0200
Committer: Wei Zhou <w.zhou@leaseweb.com>
Committed: Fri Aug 2 11:50:19 2013 +0200

----------------------------------------------------------------------
 .../cloud/upgrade/DatabaseUpgradeChecker.java   | 65 +++++++++---------
 .../com/cloud/upgrade/dao/Upgrade420to430.java  | 70 ++++++++++++++++++++
 setup/db/db/schema-420to430-cleanup.sql         | 22 ++++++
 3 files changed, 126 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0529da13/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 7232058..eb987ea 100755
--- a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
+++ b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
@@ -62,6 +62,7 @@ import com.cloud.upgrade.dao.Upgrade307to410;
 import com.cloud.upgrade.dao.Upgrade30to301;
 import com.cloud.upgrade.dao.Upgrade40to41;
 import com.cloud.upgrade.dao.Upgrade410to420;
+import com.cloud.upgrade.dao.Upgrade420to430;
 import com.cloud.upgrade.dao.UpgradeSnapshot217to224;
 import com.cloud.upgrade.dao.UpgradeSnapshot223to224;
 import com.cloud.upgrade.dao.VersionDao;
@@ -88,108 +89,110 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker
{
                 new UpgradeSnapshot217to224(), new Upgrade222to224(), new Upgrade224to225(),
new Upgrade225to226(),
                 new Upgrade227to228(), new Upgrade228to229(), new Upgrade229to2210(), new
Upgrade2210to2211(),
                 new Upgrade2211to2212(), new Upgrade2212to2213(), new Upgrade2213to2214(),
new Upgrade2214to30(),
-                new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420() });
+                new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420(), new Upgrade420to430() });
 
         _upgradeMap.put("2.1.8", new DbUpgrade[] { new Upgrade218to22(), new Upgrade221to222(),
new UpgradeSnapshot217to224(),
                 new Upgrade222to224(), new Upgrade218to224DomainVlans(), new Upgrade224to225(),
new Upgrade225to226(),
                 new Upgrade227to228(), new Upgrade228to229(), new Upgrade229to2210(), new
Upgrade2210to2211(),
                 new Upgrade2211to2212(), new Upgrade2212to2213(), new Upgrade2213to2214(),
-                new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420() });
+                new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430() });
 
         _upgradeMap.put("2.1.9", new DbUpgrade[] { new Upgrade218to22(), new Upgrade221to222(),
new UpgradeSnapshot217to224(),
                 new Upgrade222to224(), new Upgrade218to224DomainVlans(), new Upgrade224to225(),
new Upgrade225to226(),
                 new Upgrade227to228(), new Upgrade228to229(), new Upgrade229to2210(), new
Upgrade2210to2211(),
                 new Upgrade2211to2212(), new Upgrade2212to2213(), new Upgrade2213to2214(),
new Upgrade2214to30(),
-                new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420() });
+                new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420(), new Upgrade420to430() });
 
         _upgradeMap.put("2.2.1", new DbUpgrade[] { new Upgrade221to222(), new UpgradeSnapshot223to224(),
new Upgrade222to224(),
                 new Upgrade224to225(), new Upgrade225to226(), new Upgrade227to228(), new
Upgrade228to229(),
                 new Upgrade229to2210(), new Upgrade2210to2211(), new Upgrade2211to2212(),
new Upgrade2212to2213(),
-                new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new
Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420() });
+                new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new
Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430()
});
 
         _upgradeMap.put("2.2.2", new DbUpgrade[] { new Upgrade222to224(), new UpgradeSnapshot223to224(),
new Upgrade224to225(),
                 new Upgrade225to226(), new Upgrade227to228(), new Upgrade228to229(), new
Upgrade229to2210(),
                 new Upgrade2210to2211(), new Upgrade2211to2212(), new Upgrade2212to2213(),
new Upgrade2213to2214(),
-                new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420() });
+                new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430() });
 
         _upgradeMap.put("2.2.3", new DbUpgrade[] { new Upgrade222to224(), new UpgradeSnapshot223to224(),
new Upgrade224to225(),
                 new Upgrade225to226(), new Upgrade227to228(), new Upgrade228to229(), new
Upgrade229to2210(),
                 new Upgrade2210to2211(), new Upgrade2211to2212(), new Upgrade2212to2213(),
new Upgrade2213to2214(),
-                new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420() });
+                new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430() });
 
         _upgradeMap.put("2.2.4", new DbUpgrade[] { new Upgrade224to225(), new Upgrade225to226(),
new Upgrade227to228(),
                 new Upgrade228to229(), new Upgrade229to2210(), new Upgrade2210to2211(), new
Upgrade2211to2212(),
                 new Upgrade2212to2213(), new Upgrade2213to2214(), new Upgrade2214to30(),
new Upgrade30to301(),
-                new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420()
});
+                new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to430() });
 
         _upgradeMap.put("2.2.5", new DbUpgrade[] { new Upgrade225to226(), new Upgrade227to228(),
new Upgrade228to229(),
                 new Upgrade229to2210(), new Upgrade2210to2211(), new Upgrade2211to2212(),
new Upgrade2212to2213(),
                 new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new
Upgrade301to302(),
-                new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420() });
+                new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430()
});
 
         _upgradeMap.put("2.2.6", new DbUpgrade[] { new Upgrade227to228(), new Upgrade228to229(),
new Upgrade229to2210(),
                 new Upgrade2210to2211(), new Upgrade2211to2212(), new Upgrade2212to2213(),
new Upgrade2213to2214(),
-                new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420() });
+                new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430() });
 
         _upgradeMap.put("2.2.7", new DbUpgrade[] { new Upgrade227to228(), new Upgrade228to229(),
new Upgrade229to2210(),
                 new Upgrade2210to2211(), new Upgrade2211to2212(), new Upgrade2212to2213(),
-                new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new
Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420() });
+                new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new
Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430()
});
 
         _upgradeMap.put("2.2.8", new DbUpgrade[] { new Upgrade228to229(), new Upgrade229to2210(),
new Upgrade2210to2211(),
                 new Upgrade2211to2212(), new Upgrade2212to2213(), new Upgrade2213to2214(),
new Upgrade2214to30()
-        , new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420() });
+        , new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420(), new Upgrade420to430() });
 
         _upgradeMap.put("2.2.9", new DbUpgrade[] { new Upgrade229to2210(), new Upgrade2210to2211(),
new Upgrade2211to2212(),
                 new Upgrade2212to2213(), new Upgrade2213to2214(), new Upgrade2214to30(),
new Upgrade30to301(),
-                new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420()
});
+                new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to430() });
 
         _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 Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new
Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430()
});
 
         _upgradeMap.put("2.2.11", new DbUpgrade[] { new Upgrade2211to2212(), new Upgrade2212to2213(),
new Upgrade2213to2214(),
-                new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420() });
+                new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430() });
 
         _upgradeMap.put("2.2.12", new DbUpgrade[] { new Upgrade2212to2213(), new Upgrade2213to2214(),
new Upgrade2214to30(),
-                new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420() });
+                new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420(), new Upgrade420to430() });
 
         _upgradeMap.put("2.2.13", new DbUpgrade[] { new Upgrade2213to2214(), new Upgrade2214to30(),
new Upgrade30to301(),
-                new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420()
});
+                new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to430() });
 
         _upgradeMap.put("2.2.14", new DbUpgrade[] { new Upgrade2214to30(), new Upgrade30to301(),
new Upgrade301to302(),
-                new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420() });
+                new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430()
});
         
         
 
-        _upgradeMap.put("3.0.0", new DbUpgrade[] { new Upgrade30to301(), new Upgrade301to302(),
new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420() });
+        _upgradeMap.put("3.0.0", new DbUpgrade[] { new Upgrade30to301(), new Upgrade301to302(),
new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430() });
 
-        _upgradeMap.put("3.0.1", new DbUpgrade[] { new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420() });
+        _upgradeMap.put("3.0.1", new DbUpgrade[] { new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to430() });
 
-        _upgradeMap.put("3.0.2", new DbUpgrade[] { new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420() });
+        _upgradeMap.put("3.0.2", new DbUpgrade[] { new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420(), new Upgrade420to430() });
 
-        _upgradeMap.put("4.0.0", new DbUpgrade[] { new Upgrade40to41(), new Upgrade410to420()
});
+        _upgradeMap.put("4.0.0", new DbUpgrade[] { new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to430() });
 
-        _upgradeMap.put("4.0.1", new DbUpgrade[] { new Upgrade40to41(), new Upgrade410to420()
});
+        _upgradeMap.put("4.0.1", new DbUpgrade[] { new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to430() });
 
-        _upgradeMap.put("4.0.2", new DbUpgrade[] { new Upgrade40to41(), new Upgrade410to420()
});
+        _upgradeMap.put("4.0.2", new DbUpgrade[] { new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to430() });
 
-        _upgradeMap.put("4.1.0", new DbUpgrade[] { new Upgrade410to420() });
+        _upgradeMap.put("4.1.0", new DbUpgrade[] { new Upgrade410to420(), new Upgrade420to430()
});
+
+        _upgradeMap.put("4.2.0", new DbUpgrade[] { new Upgrade420to430() });
         
         //CP Upgrades
-        _upgradeMap.put("3.0.3", new DbUpgrade[] { new Upgrade303to304(), new Upgrade304to305(),
new Upgrade305to306(), new Upgrade306to307(), new Upgrade307to410(), new Upgrade410to420()
});
+        _upgradeMap.put("3.0.3", new DbUpgrade[] { new Upgrade303to304(), new Upgrade304to305(),
new Upgrade305to306(), new Upgrade306to307(), new Upgrade307to410(), new Upgrade410to420(),
new Upgrade420to430() });
         
-        _upgradeMap.put("3.0.4", new DbUpgrade[] { new Upgrade304to305(), new Upgrade305to306(),
new Upgrade306to307(), new Upgrade307to410(), new Upgrade410to420() });
+        _upgradeMap.put("3.0.4", new DbUpgrade[] { new Upgrade304to305(), new Upgrade305to306(),
new Upgrade306to307(), new Upgrade307to410(), new Upgrade410to420(), new Upgrade420to430()
});
         
-        _upgradeMap.put("3.0.5", new DbUpgrade[] { new Upgrade305to306(), new Upgrade306to307(),
new Upgrade307to410(), new Upgrade410to420() });
+        _upgradeMap.put("3.0.5", new DbUpgrade[] { new Upgrade305to306(), new Upgrade306to307(),
new Upgrade307to410(), new Upgrade410to420(), new Upgrade420to430() });
         
-        _upgradeMap.put("3.0.6", new DbUpgrade[] { new Upgrade306to307(), new Upgrade307to410(),
new Upgrade410to420() });
+        _upgradeMap.put("3.0.6", new DbUpgrade[] { new Upgrade306to307(), new Upgrade307to410(),
new Upgrade410to420(), new Upgrade420to430() });
         
-        _upgradeMap.put("3.0.7", new DbUpgrade[] { new Upgrade307to410(), new Upgrade410to420()
});
+        _upgradeMap.put("3.0.7", new DbUpgrade[] { new Upgrade307to410(), new Upgrade410to420(),
new Upgrade420to430() });
         
         _upgradeMap.put("2.2.15", new DbUpgrade[] { new Upgrade2214to30(), new Upgrade30to301(),
new Upgrade301to302(),
-                new Upgrade302to303(), new Upgrade303to304(), new Upgrade304to305(), new
Upgrade305to306(),  new Upgrade306to307(),new Upgrade307to410(), new Upgrade410to420()});
+                new Upgrade302to303(), new Upgrade303to304(), new Upgrade304to305(), new
Upgrade305to306(),  new Upgrade306to307(),new Upgrade307to410(), new Upgrade410to420(), new
Upgrade420to430()});
         
         _upgradeMap.put("2.2.16", new DbUpgrade[] { new Upgrade2214to30(), new Upgrade30to301(),
new Upgrade301to302(),
-                new Upgrade302to303(), new Upgrade303to304(), new Upgrade304to305(), new
Upgrade305to306(),  new Upgrade306to307(),new Upgrade307to410(), new Upgrade410to420()});
+                new Upgrade302to303(), new Upgrade303to304(), new Upgrade304to305(), new
Upgrade305to306(),  new Upgrade306to307(),new Upgrade307to410(), new Upgrade410to420(), new
Upgrade420to430()});
     }
 
     protected void runScript(Connection conn, File file) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0529da13/engine/schema/src/com/cloud/upgrade/dao/Upgrade420to430.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade420to430.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade420to430.java
new file mode 100644
index 0000000..ab82cc9
--- /dev/null
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade420to430.java
@@ -0,0 +1,70 @@
+// 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 Upgrade420to430 implements DbUpgrade {
+    final static Logger s_logger = Logger.getLogger(Upgrade420to430.class);
+
+    @Override
+    public String[] getUpgradableVersionRange() {
+        return new String[] { "4.2.0", "4.3.0" };
+    }
+
+    @Override
+    public String getUpgradedVersion() {
+        return "4.3.0";
+    }
+
+    @Override
+    public boolean supportsRollingUpgrade() {
+        return false;
+    }
+
+    @Override
+    public File[] getPrepareScripts() {
+        String script = Script.findScript("", "db/schema-420to430.sql");
+        if (script == null) {
+            throw new CloudRuntimeException("Unable to find db/schema-420to430.sql");
+        }
+
+        return new File[] { new File(script) };
+    }
+
+    @Override
+    public void performDataMigration(Connection conn) {
+    }
+
+    @Override
+    public File[] getCleanupScripts() {
+        String script = Script.findScript("", "db/schema-420to430-cleanup.sql");
+        if (script == null) {
+            throw new CloudRuntimeException("Unable to find db/schema-420to430-cleanup.sql");
+        }
+
+        return new File[] { new File(script) };
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0529da13/setup/db/db/schema-420to430-cleanup.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-420to430-cleanup.sql b/setup/db/db/schema-420to430-cleanup.sql
new file mode 100644
index 0000000..ce5a220
--- /dev/null
+++ b/setup/db/db/schema-420to430-cleanup.sql
@@ -0,0 +1,22 @@
+-- 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.
+
+--;
+-- Schema cleanup from 4.2.0 to 4.3.0;
+--;
+
+


Mime
View raw message