cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject git commit: updated refs/heads/master to 774739f
Date Fri, 14 Mar 2014 16:15:20 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 15b6860c6 -> 774739fb9


Fix database upgrade from 4.4.0 to 4.5.0


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

Branch: refs/heads/master
Commit: 774739fb97f0951aacf566e23b0d3782035c385a
Parents: 15b6860
Author: Hugo Trippaers <htrippaers@schubergphilis.com>
Authored: Fri Mar 14 17:14:57 2014 +0100
Committer: Hugo Trippaers <htrippaers@schubergphilis.com>
Committed: Fri Mar 14 17:14:57 2014 +0100

----------------------------------------------------------------------
 .../cloud/upgrade/DatabaseUpgradeChecker.java   | 187 ++++++++++---------
 .../com/cloud/upgrade/dao/Upgrade440to450.java  |  70 +++++++
 setup/db/db/schema-430to440.sql                 |   4 +-
 setup/db/db/schema-440to450-cleanup.sql         |  22 +++
 setup/db/db/schema-440to450.sql                 |  24 +++
 5 files changed, 219 insertions(+), 88 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/774739fb/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 0761c9f..f508df2 100755
--- a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
+++ b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
@@ -66,6 +66,7 @@ import com.cloud.upgrade.dao.Upgrade410to420;
 import com.cloud.upgrade.dao.Upgrade420to421;
 import com.cloud.upgrade.dao.Upgrade421to430;
 import com.cloud.upgrade.dao.Upgrade430to440;
+import com.cloud.upgrade.dao.Upgrade440to450;
 import com.cloud.upgrade.dao.UpgradeSnapshot217to224;
 import com.cloud.upgrade.dao.UpgradeSnapshot223to224;
 import com.cloud.upgrade.dao.VersionDao;
@@ -91,149 +92,163 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker
{
         _dao = new VersionDaoImpl();
 
         _upgradeMap.put("2.1.7", new DbUpgrade[] {new Upgrade217to218(), new Upgrade218to22(),
new Upgrade221to222(),
-            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 Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440()});
+                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 Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new
Upgrade440to450()});
 
         _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 Upgrade420to421(),
-            new Upgrade421to430(), new Upgrade430to440()});
+                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 Upgrade420to421(),
+                new Upgrade421to430(), new Upgrade430to440(),
+                new Upgrade440to450()});
 
         _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 Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440()});
+                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 Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(),
+                new Upgrade440to450()});
 
         _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 Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440()});
+                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 Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new
Upgrade440to450()});
 
         _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 Upgrade420to421(),
-            new Upgrade421to430(), new Upgrade430to440()});
+                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 Upgrade420to421(),
+                new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to450()});
 
         _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 Upgrade420to421(),
-            new Upgrade421to430(), new Upgrade430to440()});
+                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 Upgrade420to421(),
+                new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to450()});
 
         _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 Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440()});
+                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 Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(),
+                new Upgrade440to450()});
 
         _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 Upgrade420to421(),
new Upgrade421to430(), new Upgrade430to440()});
+                new Upgrade229to2210(), 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 Upgrade440to450()});
 
         _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 Upgrade420to421(),
-            new Upgrade421to430(), new Upgrade430to440()});
+                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 Upgrade440to450()});
 
         _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 Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440()});
+                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
Upgrade440to450()});
 
         _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 Upgrade420to421(),
-            new Upgrade421to430(), new Upgrade430to440()});
+                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
Upgrade440to450()});
 
         _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 Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440()});
+                new Upgrade2212to2213(), new Upgrade2213to2214(), new Upgrade2214to30(),
new Upgrade30to301(),
+                new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to421(),
+                new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to450()});
 
         _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 Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new
Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(),
+                new Upgrade410to420(),
+                new Upgrade420to421(), new Upgrade421to430(),
+                new Upgrade430to440(), new Upgrade440to450()});
 
         _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 Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to421(),
+                new Upgrade421to430(),
+                new Upgrade430to440(), new Upgrade440to450()});
 
         _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(),
-            new Upgrade430to440()});
+                new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(),
+                new Upgrade430to440(), new Upgrade440to450()});
 
         _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(), new Upgrade430to440()});
+                new Upgrade301to302(), new Upgrade302to40(),
+                new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(),
new Upgrade430to440(), new Upgrade440to450()});
 
         _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 Upgrade302to40(), new Upgrade40to41(),
+                new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), new
Upgrade430to440(), new Upgrade440to450()});
 
         _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()});
+                new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(),
new Upgrade440to450()});
 
         _upgradeMap.put("2.2.14", new DbUpgrade[] {new Upgrade2214to30(), new Upgrade30to301(),
new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(),
-            new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430()});
+                new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), new
Upgrade440to450()});
 
         _upgradeMap.put("3.0.0", new DbUpgrade[] {new Upgrade30to301(), new Upgrade301to302(),
new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(),
-            new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440()});
+                new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new
Upgrade440to450()});
 
         _upgradeMap.put("3.0.1", new DbUpgrade[] {new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to421(),
-            new Upgrade421to430(), new Upgrade430to440()});
+                new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to450()});
 
         _upgradeMap.put("3.0.2", new DbUpgrade[] {new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(),
-            new Upgrade430to440()});
+                new Upgrade430to440(), new Upgrade440to450()});
 
-        _upgradeMap.put("4.0.0", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440()});
+        _upgradeMap.put("4.0.0", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(),
+                new Upgrade440to450()});
 
-        _upgradeMap.put("4.0.1", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440()});
+        _upgradeMap.put("4.0.1", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(),
+                new Upgrade440to450()});
 
-        _upgradeMap.put("4.0.2", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440()});
+        _upgradeMap.put("4.0.2", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(),
+                new Upgrade440to450()});
 
-        _upgradeMap.put("4.1.0", new DbUpgrade[] {new Upgrade410to420(), new Upgrade420to421(),
new Upgrade421to430(), new Upgrade430to440()});
+        _upgradeMap.put("4.1.0", new DbUpgrade[] {new Upgrade410to420(), new Upgrade420to421(),
new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to450()});
 
-        _upgradeMap.put("4.1.1", new DbUpgrade[] {new Upgrade410to420(), new Upgrade420to421(),
new Upgrade421to430(), new Upgrade430to440()});
+        _upgradeMap.put("4.1.1", new DbUpgrade[] {new Upgrade410to420(), new Upgrade420to421(),
new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to450()});
 
-        _upgradeMap.put("4.2.0", new DbUpgrade[] {new Upgrade420to421(), new Upgrade421to430(),
new Upgrade430to440()});
+        _upgradeMap.put("4.2.0", new DbUpgrade[] {new Upgrade420to421(), new Upgrade421to430(),
new Upgrade430to440(), new Upgrade440to450()});
 
-        _upgradeMap.put("4.2.1", new DbUpgrade[] {new Upgrade421to430(), new Upgrade430to440()});
+        _upgradeMap.put("4.2.1", new DbUpgrade[] {new Upgrade421to430(), new Upgrade430to440(),
new Upgrade440to450()});
 
-        _upgradeMap.put("4.3.0", new DbUpgrade[] {new Upgrade430to440()});
+        _upgradeMap.put("4.3.0", new DbUpgrade[] {new Upgrade430to440(), new Upgrade440to450()});
 
         //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 Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), new
Upgrade430to440(), new Upgrade440to450()});
 
         _upgradeMap.put("3.0.4", new DbUpgrade[] {new Upgrade304to305(), new Upgrade305to306(),
new Upgrade306to307(), new Upgrade307to410(), new Upgrade410to420(),
-            new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440()});
+                new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new
Upgrade440to450()});
 
         _upgradeMap.put("3.0.5", new DbUpgrade[] {new Upgrade305to306(), new Upgrade306to307(),
new Upgrade307to410(), new Upgrade410to420(), new Upgrade420to421(),
-            new Upgrade421to430(), new Upgrade430to440()});
+                new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to450()});
 
         _upgradeMap.put("3.0.6", new DbUpgrade[] {new Upgrade306to307(), new Upgrade307to410(),
new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(),
-            new Upgrade430to440()});
+                new Upgrade430to440(), new Upgrade440to450()});
 
-        _upgradeMap.put("3.0.7", new DbUpgrade[] {new Upgrade307to410(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440()});
+        _upgradeMap.put("3.0.7", new DbUpgrade[] {new Upgrade307to410(), new Upgrade410to420(),
new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(),
+                new Upgrade440to450()});
 
         _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 Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440()});
+                new Upgrade302to303(), new Upgrade303to304(), new Upgrade304to305(), new
Upgrade305to306(), new Upgrade306to307(), new Upgrade307to410(),
+                new Upgrade410to420(),
+ new Upgrade420to421(), new Upgrade421to430(),
+                new Upgrade430to440(), new Upgrade440to450()});
 
         _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 Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440()});
+                new Upgrade302to303(), new Upgrade303to304(), new Upgrade304to305(), new
Upgrade305to306(), new Upgrade306to307(), new Upgrade307to410(),
+                new Upgrade410to420(),
+ new Upgrade420to421(), new Upgrade421to430(),
+                new Upgrade430to440(), new Upgrade440to450()});
     }
 
     protected void runScript(Connection conn, File file) {
@@ -267,9 +282,9 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker
{
 
         if (Version.compare(trimmedCurrentVersion, upgrades[upgrades.length - 1].getUpgradedVersion())
!= 0) {
             s_logger.error("The end upgrade version is actually at " + upgrades[upgrades.length
- 1].getUpgradedVersion() +
-                " but our management server code version is at " + currentVersion);
+                    " but our management server code version is at " + currentVersion);
             throw new CloudRuntimeException("The end upgrade version is actually at " + upgrades[upgrades.length
- 1].getUpgradedVersion() +
-                " but our management server code version is at " + currentVersion);
+                    " but our management server code version is at " + currentVersion);
         }
 
         boolean supportsRollingUpgrade = true;
@@ -281,15 +296,15 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker
{
         }
 
         if (!supportsRollingUpgrade && false) { // FIXME: Needs to detect if there
are management servers running
-                                                // ClusterManagerImpl.arePeersRunning(null))
{
+            // ClusterManagerImpl.arePeersRunning(null)) {
             s_logger.error("Unable to run upgrade because the upgrade sequence does not support
rolling update and there are other management server nodes running");
             throw new CloudRuntimeException(
-                "Unable to run upgrade because the upgrade sequence does not support rolling
update and there are other management server nodes running");
+                    "Unable to run upgrade because the upgrade sequence does not support
rolling update and there are other management server nodes running");
         }
 
         for (DbUpgrade upgrade : upgrades) {
             s_logger.debug("Running upgrade " + upgrade.getClass().getSimpleName() + " to
upgrade from " + upgrade.getUpgradableVersionRange()[0] + "-" +
-                upgrade.getUpgradableVersionRange()[1] + " to " + upgrade.getUpgradedVersion());
+                    upgrade.getUpgradableVersionRange()[1] + " to " + upgrade.getUpgradedVersion());
             TransactionLegacy txn = TransactionLegacy.open("Upgrade");
             txn.start();
             try {
@@ -341,7 +356,7 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker
{
         }
 
         if (true) { // FIXME Needs to detect if management servers are running
-                    // !ClusterManagerImpl.arePeersRunning(trimmedCurrentVersion)) {
+            // !ClusterManagerImpl.arePeersRunning(trimmedCurrentVersion)) {
             s_logger.info("Cleaning upgrades because all management server are now at the
same version");
             TreeMap<String, List<DbUpgrade>> upgradedVersions = new TreeMap<String,
List<DbUpgrade>>();
 
@@ -365,7 +380,7 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker
{
                     if (version != null) {
                         for (DbUpgrade upgrade : versionUpgrades) {
                             s_logger.info("Cleanup upgrade " + upgrade.getClass().getSimpleName()
+ " to upgrade from " + upgrade.getUpgradableVersionRange()[0] + "-" +
-                                upgrade.getUpgradableVersionRange()[1] + " to " + upgrade.getUpgradedVersion());
+                                    upgrade.getUpgradableVersionRange()[1] + " to " + upgrade.getUpgradedVersion());
 
                             txn.start();
 

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

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/774739fb/setup/db/db/schema-430to440.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql
index 5c5511a..9a44835 100644
--- a/setup/db/db/schema-430to440.sql
+++ b/setup/db/db/schema-430to440.sql
@@ -664,9 +664,9 @@ CREATE TABLE `cloud`.`op_router_monitoring_services` (
   `last_alert_timestamp` varchar(255) NOT NULL COMMENT 'Timestamp of the last alert received
from Virtual Router',
    PRIMARY KEY (`vm_id`),
    CONSTRAINT `fk_virtual_router__id` FOREIGN KEY `fk_virtual_router__id` (`vm_id`) REFERENCES
`vm_instance`(`id`) ON DELETE CASCADE
-) ENGINE = InnoDB DEFAULT CHARSET=utf8
+) ENGINE = InnoDB DEFAULT CHARSET=utf8;
 
-ALTER TABLE `cloud`.`event` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '1' COMMENT
'True if the detail can be displayed to the end user';
+ALTER TABLE `cloud`.`event` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'True
if the detail can be displayed to the end user';
 
 DROP VIEW IF EXISTS `cloud`.`event_view`;
 CREATE VIEW `cloud`.`event_view` AS

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/774739fb/setup/db/db/schema-440to450-cleanup.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-440to450-cleanup.sql b/setup/db/db/schema-440to450-cleanup.sql
new file mode 100644
index 0000000..2345713
--- /dev/null
+++ b/setup/db/db/schema-440to450-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.4.0 to 4.5.0
+--
+
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/774739fb/setup/db/db/schema-440to450.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-440to450.sql b/setup/db/db/schema-440to450.sql
new file mode 100644
index 0000000..2bd5386
--- /dev/null
+++ b/setup/db/db/schema-440to450.sql
@@ -0,0 +1,24 @@
+-- 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 upgrade from 4.4.0 to 4.5.0
+--
+
+-- Disable foreign key checking
+-- SET foreign_key_checks = 0;
+


Mime
View raw message