Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A8ED411153 for ; Mon, 28 Jul 2014 22:23:11 +0000 (UTC) Received: (qmail 73487 invoked by uid 500); 28 Jul 2014 22:23:11 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 73456 invoked by uid 500); 28 Jul 2014 22:23:11 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 73446 invoked by uid 99); 28 Jul 2014 22:23:11 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jul 2014 22:23:11 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 343969B8E3E; Mon, 28 Jul 2014 22:23:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bhaisaab@apache.org To: commits@cloudstack.apache.org Message-Id: <43ec307f61a6404fa99a038ce37b2f08@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/master to d42e204 Date: Mon, 28 Jul 2014 22:23:11 +0000 (UTC) Repository: cloudstack Updated Branches: refs/heads/master fa74b3a30 -> d42e20429 schema: add upgrade path from 4.4.0 to 4.5.0 via 4.4.1 Signed-off-by: Rohit Yadav Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d42e2042 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d42e2042 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d42e2042 Branch: refs/heads/master Commit: d42e20429d1e238816a07edd865567c06a4914d3 Parents: fa74b3a Author: Rohit Yadav Authored: Mon Jul 28 23:51:58 2014 +0200 Committer: Rohit Yadav Committed: Tue Jul 29 00:21:39 2014 +0200 ---------------------------------------------------------------------- .../cloud/upgrade/DatabaseUpgradeChecker.java | 177 ++++---- .../com/cloud/upgrade/dao/Upgrade440to441.java | 69 +++ .../com/cloud/upgrade/dao/Upgrade440to450.java | 88 ---- .../com/cloud/upgrade/dao/Upgrade441to450.java | 88 ++++ setup/db/db/schema-440to441-cleanup.sql | 20 + setup/db/db/schema-440to441.sql | 23 + setup/db/db/schema-440to450-cleanup.sql | 33 -- setup/db/db/schema-440to450.sql | 431 ------------------- setup/db/db/schema-441to450-cleanup.sql | 33 ++ setup/db/db/schema-441to450.sql | 431 +++++++++++++++++++ 10 files changed, 746 insertions(+), 647 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d42e2042/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 d9569d8..c340bcf 100755 --- a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java +++ b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java @@ -66,7 +66,8 @@ 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.Upgrade440to441; +import com.cloud.upgrade.dao.Upgrade441to450; import com.cloud.upgrade.dao.UpgradeSnapshot217to224; import com.cloud.upgrade.dao.UpgradeSnapshot223to224; import com.cloud.upgrade.dao.VersionDao; @@ -92,165 +93,151 @@ 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 Upgrade440to450()}); + 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 Upgrade440to441(), new Upgrade441to450()}); _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 Upgrade440to450()}); + 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 Upgrade440to441(), new Upgrade441to450()}); _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 Upgrade440to450()}); + 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 Upgrade440to441(), new Upgrade441to450()}); _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 Upgrade440to450()}); + 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 Upgrade440to441(), new Upgrade441to450()}); _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 Upgrade440to450()}); + 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 Upgrade440to441(), new Upgrade441to450()}); _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 Upgrade440to450()}); + 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 Upgrade440to441(), new Upgrade441to450()}); _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 Upgrade440to450()}); + 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 Upgrade440to441(), new Upgrade441to450()}); _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 Upgrade440to450()}); + 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 Upgrade440to441(), new Upgrade441to450()}); _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 Upgrade440to450()}); + 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 Upgrade441to450()}); _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 Upgrade440to450()}); + 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 Upgrade441to450()}); _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 Upgrade440to450()}); + 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 Upgrade441to450()}); _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 Upgrade440to450()}); + 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 Upgrade441to450()}); _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 Upgrade440to450()}); + new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), + new Upgrade410to420(), + new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to450()}); _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 Upgrade440to450()}); + new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to421(), + new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to450()}); _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 Upgrade440to450()}); + new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), + new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to450()}); _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 Upgrade440to450()}); + new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to450()}); _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 Upgrade440to450()}); + new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to450()}); _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 Upgrade440to450()}); + new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), new Upgrade440to441(), new Upgrade441to450()}); _upgradeMap.put("2.2.14", new DbUpgrade[] {new Upgrade2214to30(), new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), - new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), new Upgrade440to450()}); + new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), new Upgrade440to441(), new Upgrade441to450()}); _upgradeMap.put("3.0.0", new DbUpgrade[] {new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), - new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to450()}); + new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to450()}); _upgradeMap.put("3.0.1", new DbUpgrade[] {new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to421(), - new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to450()}); + new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to450()}); _upgradeMap.put("3.0.2", new DbUpgrade[] {new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), - new Upgrade430to440(), new Upgrade440to450()}); + new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to450()}); - _upgradeMap.put("4.0.0", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), - new Upgrade440to450()}); + _upgradeMap.put("4.0.0", new DbUpgrade[] {new Upgrade40to41(), new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to450()}); - _upgradeMap.put("4.0.1", 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(), new Upgrade440to441(), new Upgrade441to450()}); - _upgradeMap.put("4.0.2", 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(), new Upgrade440to441(), new Upgrade441to450()}); - _upgradeMap.put("4.1.0", new DbUpgrade[] {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(), new Upgrade440to441(), new Upgrade441to450()}); - _upgradeMap.put("4.1.1", 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(), new Upgrade440to441(), new Upgrade441to450()}); - _upgradeMap.put("4.2.0", new DbUpgrade[] {new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to450()}); + _upgradeMap.put("4.2.0", new DbUpgrade[] {new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to450()}); - _upgradeMap.put("4.2.1", new DbUpgrade[] {new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to450()}); + _upgradeMap.put("4.2.1", new DbUpgrade[] {new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to450()}); - _upgradeMap.put("4.3.0", new DbUpgrade[] {new Upgrade430to440(), new Upgrade440to450()}); + _upgradeMap.put("4.3.0", new DbUpgrade[] {new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to450()}); - _upgradeMap.put("4.4.0", new DbUpgrade[] { new Upgrade440to450() }); + _upgradeMap.put("4.4.0", new DbUpgrade[] {new Upgrade440to441(), new Upgrade441to450()}); //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 Upgrade440to450()}); + new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to450(), new Upgrade440to441(), new Upgrade441to450()}); _upgradeMap.put("3.0.4", new DbUpgrade[] {new Upgrade304to305(), new Upgrade305to306(), new Upgrade306to307(), new Upgrade307to410(), new Upgrade410to420(), - new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to450()}); + new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to450(), new Upgrade440to441(), new Upgrade441to450()}); _upgradeMap.put("3.0.5", new DbUpgrade[] {new Upgrade305to306(), new Upgrade306to307(), new Upgrade307to410(), new Upgrade410to420(), new Upgrade420to421(), - new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to450()}); + new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to450(), new Upgrade440to441(), new Upgrade441to450()}); _upgradeMap.put("3.0.6", new DbUpgrade[] {new Upgrade306to307(), new Upgrade307to410(), new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), - new Upgrade430to440(), new Upgrade440to450()}); + new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to450()}); - _upgradeMap.put("3.0.7", new DbUpgrade[] {new Upgrade307to410(), new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), - new Upgrade440to450()}); + _upgradeMap.put("3.0.7", new DbUpgrade[] {new Upgrade307to410(), new Upgrade410to420(), new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to450()}); _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 Upgrade440to450()}); + new Upgrade302to303(), new Upgrade303to304(), new Upgrade304to305(), new Upgrade305to306(), new Upgrade306to307(), new Upgrade307to410(), + new Upgrade410to420(), + new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to450()}); _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 Upgrade440to450()}); + new Upgrade302to303(), new Upgrade303to304(), new Upgrade304to305(), new Upgrade305to306(), new Upgrade306to307(), new Upgrade307to410(), + new Upgrade410to420(), + new Upgrade420to421(), new Upgrade421to430(), new Upgrade430to440(), new Upgrade440to441(), new Upgrade441to450()}); } protected void runScript(Connection conn, File file) { http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d42e2042/engine/schema/src/com/cloud/upgrade/dao/Upgrade440to441.java ---------------------------------------------------------------------- diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade440to441.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade440to441.java new file mode 100644 index 0000000..497da8d --- /dev/null +++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade440to441.java @@ -0,0 +1,69 @@ +// 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 Upgrade440to441 implements DbUpgrade { + final static Logger s_logger = Logger.getLogger(Upgrade440to441.class); + + @Override + public String[] getUpgradableVersionRange() { + return new String[] {"4.4.0", "4.4.1"}; + } + + @Override + public String getUpgradedVersion() { + return "4.4.1"; + } + + @Override + public boolean supportsRollingUpgrade() { + return false; + } + + @Override + public File[] getPrepareScripts() { + String script = Script.findScript("", "db/schema-440to441.sql"); + if (script == null) { + throw new CloudRuntimeException("Unable to find db/schema-440to441.sql"); + } + + return new File[] {new File(script)}; + } + + @Override + public void performDataMigration(Connection conn) { + } + + @Override + public File[] getCleanupScripts() { + String script = Script.findScript("", "db/schema-440to441-cleanup.sql"); + if (script == null) { + throw new CloudRuntimeException("Unable to find db/schema-440to441-cleanup.sql"); + } + + return new File[] {new File(script)}; + } +} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d42e2042/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 deleted file mode 100644 index aad5162..0000000 --- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade440to450.java +++ /dev/null @@ -1,88 +0,0 @@ -// 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 java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -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) { - dropInvalidKeyFromStoragePoolTable(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)}; - } - - private void dropInvalidKeyFromStoragePoolTable(Connection conn) { - HashMap> uniqueKeys = new HashMap>(); - List keys = new ArrayList(); - - keys.add("id_2"); - uniqueKeys.put("storage_pool", keys); - - s_logger.debug("Droping id_2 key from storage_pool table"); - for (Map.Entry> entry: uniqueKeys.entrySet()) { - DbUpgradeUtils.dropKeysIfExist(conn,entry.getKey(), entry.getValue(), false); - } - } -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d42e2042/engine/schema/src/com/cloud/upgrade/dao/Upgrade441to450.java ---------------------------------------------------------------------- diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade441to450.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade441to450.java new file mode 100644 index 0000000..d19fbed --- /dev/null +++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade441to450.java @@ -0,0 +1,88 @@ +// 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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; + +import com.cloud.utils.exception.CloudRuntimeException; +import com.cloud.utils.script.Script; + +public class Upgrade441to450 implements DbUpgrade { + final static Logger s_logger = Logger.getLogger(Upgrade441to450.class); + + @Override + public String[] getUpgradableVersionRange() { + return new String[] {"4.4.1", "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-441to450.sql"); + if (script == null) { + throw new CloudRuntimeException("Unable to find db/schema-441to450.sql"); + } + + return new File[] {new File(script)}; + } + + @Override + public void performDataMigration(Connection conn) { + dropInvalidKeyFromStoragePoolTable(conn); + } + + + @Override + public File[] getCleanupScripts() { + String script = Script.findScript("", "db/schema-441to450-cleanup.sql"); + if (script == null) { + throw new CloudRuntimeException("Unable to find db/schema-441to450-cleanup.sql"); + } + + return new File[] {new File(script)}; + } + + private void dropInvalidKeyFromStoragePoolTable(Connection conn) { + HashMap> uniqueKeys = new HashMap>(); + List keys = new ArrayList(); + + keys.add("id_2"); + uniqueKeys.put("storage_pool", keys); + + s_logger.debug("Droping id_2 key from storage_pool table"); + for (Map.Entry> entry: uniqueKeys.entrySet()) { + DbUpgradeUtils.dropKeysIfExist(conn,entry.getKey(), entry.getValue(), false); + } + } +} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d42e2042/setup/db/db/schema-440to441-cleanup.sql ---------------------------------------------------------------------- diff --git a/setup/db/db/schema-440to441-cleanup.sql b/setup/db/db/schema-440to441-cleanup.sql new file mode 100644 index 0000000..3456341 --- /dev/null +++ b/setup/db/db/schema-440to441-cleanup.sql @@ -0,0 +1,20 @@ +-- 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.4.1; +--; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d42e2042/setup/db/db/schema-440to441.sql ---------------------------------------------------------------------- diff --git a/setup/db/db/schema-440to441.sql b/setup/db/db/schema-440to441.sql new file mode 100644 index 0000000..df12ea4 --- /dev/null +++ b/setup/db/db/schema-440to441.sql @@ -0,0 +1,23 @@ +-- 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.4.1; +--; + +-- Disable foreign key checking +SET foreign_key_checks = 0; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d42e2042/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 deleted file mode 100644 index d657d2e..0000000 --- a/setup/db/db/schema-440to450-cleanup.sql +++ /dev/null @@ -1,33 +0,0 @@ --- 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 --- - -UPDATE `cloud`.`configuration` -SET name = 'router.template.xenserver' -Where name = 'router.template.xen'; - -UPDATE `cloud`.`configuration` -SET name = 'xenserver.nics.max', -description = 'Maximum allowed nics for Vms created on XenServer' -Where name = 'xen.nics.max'; - -UPDATE `cloud`.`configuration` -SET value = 'XenServer' -Where value = 'Xen'; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d42e2042/setup/db/db/schema-440to450.sql ---------------------------------------------------------------------- diff --git a/setup/db/db/schema-440to450.sql b/setup/db/db/schema-440to450.sql deleted file mode 100644 index b8a829a..0000000 --- a/setup/db/db/schema-440to450.sql +++ /dev/null @@ -1,431 +0,0 @@ --- 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; - -ALTER TABLE `cloud`.`volumes` ADD COLUMN `provisioning_type` VARCHAR(32) NOT NULL DEFAULT 'thin' COMMENT 'pre allocation setting of the volume'; -ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `provisioning_type` VARCHAR(32) NOT NULL DEFAULT 'thin' COMMENT 'pre allocation setting of the volume'; - -DROP VIEW IF EXISTS `cloud`.`disk_offering_view`; -CREATE VIEW `cloud`.`disk_offering_view` AS - select - disk_offering.id, - disk_offering.uuid, - disk_offering.name, - disk_offering.display_text, - disk_offering.provisioning_type, - disk_offering.disk_size, - disk_offering.min_iops, - disk_offering.max_iops, - disk_offering.created, - disk_offering.tags, - disk_offering.customized, - disk_offering.customized_iops, - disk_offering.removed, - disk_offering.use_local_storage, - disk_offering.system_use, - disk_offering.hv_ss_reserve, - disk_offering.bytes_read_rate, - disk_offering.bytes_write_rate, - disk_offering.iops_read_rate, - disk_offering.iops_write_rate, - disk_offering.cache_mode, - disk_offering.sort_key, - disk_offering.type, - disk_offering.display_offering, - domain.id domain_id, - domain.uuid domain_uuid, - domain.name domain_name, - domain.path domain_path - from - `cloud`.`disk_offering` - left join - `cloud`.`domain` ON disk_offering.domain_id = domain.id - where - disk_offering.state='ACTIVE'; - -DROP TABLE IF EXISTS `cloud`.`external_nuage_vsp_devices`; -CREATE TABLE `cloud`.`external_nuage_vsp_devices` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', - `uuid` varchar(255) UNIQUE, - `physical_network_id` bigint unsigned NOT NULL COMMENT 'id of the physical network in to which nuage vsp is added', - `provider_name` varchar(255) NOT NULL COMMENT 'the service provider name corresponding to this nuage vsp device', - `device_name` varchar(255) NOT NULL COMMENT 'the name of the nuage vsp device', - `host_id` bigint unsigned NOT NULL COMMENT 'host id corresponding to the external nuage vsp device', - PRIMARY KEY (`id`), - CONSTRAINT `fk_external_nuage_vsp_devices__host_id` FOREIGN KEY (`host_id`) REFERENCES `host`(`id`) ON DELETE CASCADE, - CONSTRAINT `fk_external_nuage_vsp_devices__physical_network_id` FOREIGN KEY (`physical_network_id`) REFERENCES `physical_network`(`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -DROP VIEW IF EXISTS `cloud`.`service_offering_view`; -CREATE VIEW `cloud`.`service_offering_view` AS - select - service_offering.id, - disk_offering.uuid, - disk_offering.name, - disk_offering.display_text, - disk_offering.provisioning_type, - disk_offering.created, - disk_offering.tags, - disk_offering.removed, - disk_offering.use_local_storage, - disk_offering.system_use, - disk_offering.customized_iops, - disk_offering.min_iops, - disk_offering.max_iops, - disk_offering.hv_ss_reserve, - disk_offering.bytes_read_rate, - disk_offering.bytes_write_rate, - disk_offering.iops_read_rate, - disk_offering.iops_write_rate, - disk_offering.cache_mode, - service_offering.cpu, - service_offering.speed, - service_offering.ram_size, - service_offering.nw_rate, - service_offering.mc_rate, - service_offering.ha_enabled, - service_offering.limit_cpu_use, - service_offering.host_tag, - service_offering.default_use, - service_offering.vm_type, - service_offering.sort_key, - service_offering.is_volatile, - service_offering.deployment_planner, - domain.id domain_id, - domain.uuid domain_uuid, - domain.name domain_name, - domain.path domain_path - from - `cloud`.`service_offering` - inner join - `cloud`.`disk_offering` ON service_offering.id = disk_offering.id - left join - `cloud`.`domain` ON disk_offering.domain_id = domain.id - where - disk_offering.state='Active'; - -DROP VIEW IF EXISTS `cloud`.`volume_view`; -CREATE VIEW `cloud`.`volume_view` AS - select - volumes.id, - volumes.uuid, - volumes.name, - volumes.device_id, - volumes.volume_type, - volumes.provisioning_type, - volumes.size, - volumes.min_iops, - volumes.max_iops, - volumes.created, - volumes.state, - volumes.attached, - volumes.removed, - volumes.pod_id, - volumes.display_volume, - volumes.format, - volumes.path, - volumes.chain_info, - account.id account_id, - account.uuid account_uuid, - account.account_name account_name, - account.type account_type, - domain.id domain_id, - domain.uuid domain_uuid, - domain.name domain_name, - domain.path domain_path, - projects.id project_id, - projects.uuid project_uuid, - projects.name project_name, - data_center.id data_center_id, - data_center.uuid data_center_uuid, - data_center.name data_center_name, - data_center.networktype data_center_type, - vm_instance.id vm_id, - vm_instance.uuid vm_uuid, - vm_instance.name vm_name, - vm_instance.state vm_state, - vm_instance.vm_type, - user_vm.display_name vm_display_name, - volume_store_ref.size volume_store_size, - volume_store_ref.download_pct, - volume_store_ref.download_state, - volume_store_ref.error_str, - volume_store_ref.created created_on_store, - disk_offering.id disk_offering_id, - disk_offering.uuid disk_offering_uuid, - disk_offering.name disk_offering_name, - disk_offering.display_text disk_offering_display_text, - disk_offering.use_local_storage, - disk_offering.system_use, - disk_offering.bytes_read_rate, - disk_offering.bytes_write_rate, - disk_offering.iops_read_rate, - disk_offering.iops_write_rate, - disk_offering.cache_mode, - storage_pool.id pool_id, - storage_pool.uuid pool_uuid, - storage_pool.name pool_name, - cluster.hypervisor_type, - vm_template.id template_id, - vm_template.uuid template_uuid, - vm_template.extractable, - vm_template.type template_type, - vm_template.name template_name, - vm_template.display_text template_display_text, - iso.id iso_id, - iso.uuid iso_uuid, - iso.name iso_name, - iso.display_text iso_display_text, - resource_tags.id tag_id, - resource_tags.uuid tag_uuid, - resource_tags.key tag_key, - resource_tags.value tag_value, - resource_tags.domain_id tag_domain_id, - resource_tags.account_id tag_account_id, - resource_tags.resource_id tag_resource_id, - resource_tags.resource_uuid tag_resource_uuid, - resource_tags.resource_type tag_resource_type, - resource_tags.customer tag_customer, - async_job.id job_id, - async_job.uuid job_uuid, - async_job.job_status job_status, - async_job.account_id job_account_id - from - `cloud`.`volumes` - inner join - `cloud`.`account` ON volumes.account_id = account.id - inner join - `cloud`.`domain` ON volumes.domain_id = domain.id - left join - `cloud`.`projects` ON projects.project_account_id = account.id - left join - `cloud`.`data_center` ON volumes.data_center_id = data_center.id - left join - `cloud`.`vm_instance` ON volumes.instance_id = vm_instance.id - left join - `cloud`.`user_vm` ON user_vm.id = vm_instance.id - left join - `cloud`.`volume_store_ref` ON volumes.id = volume_store_ref.volume_id - left join - `cloud`.`disk_offering` ON volumes.disk_offering_id = disk_offering.id - left join - `cloud`.`storage_pool` ON volumes.pool_id = storage_pool.id - left join - `cloud`.`cluster` ON storage_pool.cluster_id = cluster.id - left join - `cloud`.`vm_template` ON volumes.template_id = vm_template.id - left join - `cloud`.`vm_template` iso ON iso.id = volumes.iso_id - left join - `cloud`.`resource_tags` ON resource_tags.resource_id = volumes.id - and resource_tags.resource_type = 'Volume' - left join - `cloud`.`async_job` ON async_job.instance_id = volumes.id - and async_job.instance_type = 'Volume' - and async_job.job_status = 0; - -CREATE TABLE `cloud`.`external_brocade_vcs_devices` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', - `uuid` varchar(255) UNIQUE, - `physical_network_id` bigint unsigned NOT NULL COMMENT 'id of the physical network in to which brocade vcs switch is added', - `provider_name` varchar(255) NOT NULL COMMENT 'Service Provider name corresponding to this brocade vcs switch', - `device_name` varchar(255) NOT NULL COMMENT 'name of the brocade vcs switch', - `host_id` bigint unsigned NOT NULL COMMENT 'host id coresponding to the external brocade vcs switch', - PRIMARY KEY (`id`), - CONSTRAINT `fk_external_brocade_vcs_devices__host_id` FOREIGN KEY (`host_id`) REFERENCES `host`(`id`) ON DELETE CASCADE, - CONSTRAINT `fk_external_brocade_vcs_devices__physical_network_id` FOREIGN KEY (`physical_network_id`) REFERENCES `physical_network`(`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`brocade_network_vlan_map` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', - `network_id` bigint unsigned NOT NULL COMMENT 'id of the network', - `vlan_id` int(10) COMMENT 'vlan id of the network', - PRIMARY KEY (`id`), - CONSTRAINT `fk_brocade_network_vlan_map__network_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* As part of the separation of Xen and XenServer, update the column for the network labels */ -ALTER TABLE `cloud`.`physical_network_traffic_types` CHANGE `xen_network_label` `xenserver_network_label` varchar(255) COMMENT 'The network name label of the physical device dedicated to this traffic on a XenServer host'; - -/*Adding domainId field to the user table in order to restrict duplicated users creation on the db level*/ -ALTER TABLE `cloud`.`user` ADD COLUMN domain_id bigint(20) unsigned DEFAULT NULL; -ALTER TABLE `cloud`.`user` ADD CONSTRAINT `fk_user__domain_id` FOREIGN KEY `fk_user__domain_id`(`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE; -UPDATE `cloud`.`user` SET `cloud`.`user`.domain_id=(SELECT `cloud`.`account`.domain_id FROM `cloud`.`account` WHERE `cloud`.`account`.id=`cloud`.`user`.account_id) where id > 0; -ALTER TABLE `cloud`.`user` ADD UNIQUE KEY `username_domain_id` (`username`,`domain_id`); - -ALTER TABLE `cloud`.`volumes` CHANGE COLUMN `iso_id` `iso_id` bigint(20) unsigned COMMENT 'The id of the iso from which the volume was created'; - -DROP VIEW IF EXISTS `cloud`.`storage_pool_view`; -CREATE VIEW `cloud`.`storage_pool_view` AS - select - storage_pool.id, - storage_pool.uuid, - storage_pool.name, - storage_pool.status, - storage_pool.path, - storage_pool.pool_type, - storage_pool.host_address, - storage_pool.created, - storage_pool.removed, - storage_pool.capacity_bytes, - storage_pool.capacity_iops, - storage_pool.scope, - storage_pool.hypervisor, - storage_pool.storage_provider_name, - cluster.id cluster_id, - cluster.uuid cluster_uuid, - cluster.name cluster_name, - cluster.cluster_type, - data_center.id data_center_id, - data_center.uuid data_center_uuid, - data_center.name data_center_name, - data_center.networktype data_center_type, - host_pod_ref.id pod_id, - host_pod_ref.uuid pod_uuid, - host_pod_ref.name pod_name, - storage_pool_details.name tag, - op_host_capacity.used_capacity disk_used_capacity, - op_host_capacity.reserved_capacity disk_reserved_capacity, - async_job.id job_id, - async_job.uuid job_uuid, - async_job.job_status job_status, - async_job.account_id job_account_id - from - `cloud`.`storage_pool` - left join - `cloud`.`cluster` ON storage_pool.cluster_id = cluster.id - left join - `cloud`.`data_center` ON storage_pool.data_center_id = data_center.id - left join - `cloud`.`host_pod_ref` ON storage_pool.pod_id = host_pod_ref.id - left join - `cloud`.`storage_pool_details` ON storage_pool_details.pool_id = storage_pool.id - and storage_pool_details.value = 'true' - left join - `cloud`.`op_host_capacity` ON storage_pool.id = op_host_capacity.host_id - and op_host_capacity.capacity_type in (3,9) - left join - `cloud`.`async_job` ON async_job.instance_id = storage_pool.id - and async_job.instance_type = 'StoragePool' - and async_job.job_status = 0; - - -DROP VIEW IF EXISTS `cloud`.`template_view`; -CREATE VIEW `cloud`.`template_view` AS - select - vm_template.id, - vm_template.uuid, - vm_template.unique_name, - vm_template.name, - vm_template.public, - vm_template.featured, - vm_template.type, - vm_template.hvm, - vm_template.bits, - vm_template.url, - vm_template.format, - vm_template.created, - vm_template.checksum, - vm_template.display_text, - vm_template.enable_password, - vm_template.dynamically_scalable, - vm_template.state template_state, - vm_template.guest_os_id, - guest_os.uuid guest_os_uuid, - guest_os.display_name guest_os_name, - vm_template.bootable, - vm_template.prepopulate, - vm_template.cross_zones, - vm_template.hypervisor_type, - vm_template.extractable, - vm_template.template_tag, - vm_template.sort_key, - vm_template.removed, - vm_template.enable_sshkey, - source_template.id source_template_id, - source_template.uuid source_template_uuid, - account.id account_id, - account.uuid account_uuid, - account.account_name account_name, - account.type account_type, - domain.id domain_id, - domain.uuid domain_uuid, - domain.name domain_name, - domain.path domain_path, - projects.id project_id, - projects.uuid project_uuid, - projects.name project_name, - data_center.id data_center_id, - data_center.uuid data_center_uuid, - data_center.name data_center_name, - launch_permission.account_id lp_account_id, - template_store_ref.store_id, - image_store.scope as store_scope, - template_store_ref.state, - template_store_ref.download_state, - template_store_ref.download_pct, - template_store_ref.error_str, - template_store_ref.size, - template_store_ref.destroyed, - template_store_ref.created created_on_store, - vm_template_details.name detail_name, - vm_template_details.value detail_value, - resource_tags.id tag_id, - resource_tags.uuid tag_uuid, - resource_tags.key tag_key, - resource_tags.value tag_value, - resource_tags.domain_id tag_domain_id, - resource_tags.account_id tag_account_id, - resource_tags.resource_id tag_resource_id, - resource_tags.resource_uuid tag_resource_uuid, - resource_tags.resource_type tag_resource_type, - resource_tags.customer tag_customer, - CONCAT(vm_template.id, '_', IFNULL(data_center.id, 0)) as temp_zone_pair - from - `cloud`.`vm_template` - inner join - `cloud`.`guest_os` ON guest_os.id = vm_template.guest_os_id - inner join - `cloud`.`account` ON account.id = vm_template.account_id - inner join - `cloud`.`domain` ON domain.id = account.domain_id - left join - `cloud`.`projects` ON projects.project_account_id = account.id - left join - `cloud`.`vm_template_details` ON vm_template_details.template_id = vm_template.id - left join - `cloud`.`vm_template` source_template ON source_template.id = vm_template.source_template_id - left join - `cloud`.`template_store_ref` ON template_store_ref.template_id = vm_template.id and template_store_ref.store_role = 'Image' and template_store_ref.destroyed=0 - left join - `cloud`.`image_store` ON image_store.removed is NULL AND template_store_ref.store_id is not NULL AND image_store.id = template_store_ref.store_id - left join - `cloud`.`template_zone_ref` ON template_zone_ref.template_id = vm_template.id AND template_store_ref.store_id is NULL AND template_zone_ref.removed is null - left join - `cloud`.`data_center` ON (image_store.data_center_id = data_center.id OR template_zone_ref.zone_id = data_center.id) - left join - `cloud`.`launch_permission` ON launch_permission.template_id = vm_template.id - left join - `cloud`.`resource_tags` ON resource_tags.resource_id = vm_template.id - and (resource_tags.resource_type = 'Template' or resource_tags.resource_type='ISO'); - http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d42e2042/setup/db/db/schema-441to450-cleanup.sql ---------------------------------------------------------------------- diff --git a/setup/db/db/schema-441to450-cleanup.sql b/setup/db/db/schema-441to450-cleanup.sql new file mode 100644 index 0000000..d657d2e --- /dev/null +++ b/setup/db/db/schema-441to450-cleanup.sql @@ -0,0 +1,33 @@ +-- 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 +-- + +UPDATE `cloud`.`configuration` +SET name = 'router.template.xenserver' +Where name = 'router.template.xen'; + +UPDATE `cloud`.`configuration` +SET name = 'xenserver.nics.max', +description = 'Maximum allowed nics for Vms created on XenServer' +Where name = 'xen.nics.max'; + +UPDATE `cloud`.`configuration` +SET value = 'XenServer' +Where value = 'Xen'; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d42e2042/setup/db/db/schema-441to450.sql ---------------------------------------------------------------------- diff --git a/setup/db/db/schema-441to450.sql b/setup/db/db/schema-441to450.sql new file mode 100644 index 0000000..b8a829a --- /dev/null +++ b/setup/db/db/schema-441to450.sql @@ -0,0 +1,431 @@ +-- 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; + +ALTER TABLE `cloud`.`volumes` ADD COLUMN `provisioning_type` VARCHAR(32) NOT NULL DEFAULT 'thin' COMMENT 'pre allocation setting of the volume'; +ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `provisioning_type` VARCHAR(32) NOT NULL DEFAULT 'thin' COMMENT 'pre allocation setting of the volume'; + +DROP VIEW IF EXISTS `cloud`.`disk_offering_view`; +CREATE VIEW `cloud`.`disk_offering_view` AS + select + disk_offering.id, + disk_offering.uuid, + disk_offering.name, + disk_offering.display_text, + disk_offering.provisioning_type, + disk_offering.disk_size, + disk_offering.min_iops, + disk_offering.max_iops, + disk_offering.created, + disk_offering.tags, + disk_offering.customized, + disk_offering.customized_iops, + disk_offering.removed, + disk_offering.use_local_storage, + disk_offering.system_use, + disk_offering.hv_ss_reserve, + disk_offering.bytes_read_rate, + disk_offering.bytes_write_rate, + disk_offering.iops_read_rate, + disk_offering.iops_write_rate, + disk_offering.cache_mode, + disk_offering.sort_key, + disk_offering.type, + disk_offering.display_offering, + domain.id domain_id, + domain.uuid domain_uuid, + domain.name domain_name, + domain.path domain_path + from + `cloud`.`disk_offering` + left join + `cloud`.`domain` ON disk_offering.domain_id = domain.id + where + disk_offering.state='ACTIVE'; + +DROP TABLE IF EXISTS `cloud`.`external_nuage_vsp_devices`; +CREATE TABLE `cloud`.`external_nuage_vsp_devices` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', + `uuid` varchar(255) UNIQUE, + `physical_network_id` bigint unsigned NOT NULL COMMENT 'id of the physical network in to which nuage vsp is added', + `provider_name` varchar(255) NOT NULL COMMENT 'the service provider name corresponding to this nuage vsp device', + `device_name` varchar(255) NOT NULL COMMENT 'the name of the nuage vsp device', + `host_id` bigint unsigned NOT NULL COMMENT 'host id corresponding to the external nuage vsp device', + PRIMARY KEY (`id`), + CONSTRAINT `fk_external_nuage_vsp_devices__host_id` FOREIGN KEY (`host_id`) REFERENCES `host`(`id`) ON DELETE CASCADE, + CONSTRAINT `fk_external_nuage_vsp_devices__physical_network_id` FOREIGN KEY (`physical_network_id`) REFERENCES `physical_network`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP VIEW IF EXISTS `cloud`.`service_offering_view`; +CREATE VIEW `cloud`.`service_offering_view` AS + select + service_offering.id, + disk_offering.uuid, + disk_offering.name, + disk_offering.display_text, + disk_offering.provisioning_type, + disk_offering.created, + disk_offering.tags, + disk_offering.removed, + disk_offering.use_local_storage, + disk_offering.system_use, + disk_offering.customized_iops, + disk_offering.min_iops, + disk_offering.max_iops, + disk_offering.hv_ss_reserve, + disk_offering.bytes_read_rate, + disk_offering.bytes_write_rate, + disk_offering.iops_read_rate, + disk_offering.iops_write_rate, + disk_offering.cache_mode, + service_offering.cpu, + service_offering.speed, + service_offering.ram_size, + service_offering.nw_rate, + service_offering.mc_rate, + service_offering.ha_enabled, + service_offering.limit_cpu_use, + service_offering.host_tag, + service_offering.default_use, + service_offering.vm_type, + service_offering.sort_key, + service_offering.is_volatile, + service_offering.deployment_planner, + domain.id domain_id, + domain.uuid domain_uuid, + domain.name domain_name, + domain.path domain_path + from + `cloud`.`service_offering` + inner join + `cloud`.`disk_offering` ON service_offering.id = disk_offering.id + left join + `cloud`.`domain` ON disk_offering.domain_id = domain.id + where + disk_offering.state='Active'; + +DROP VIEW IF EXISTS `cloud`.`volume_view`; +CREATE VIEW `cloud`.`volume_view` AS + select + volumes.id, + volumes.uuid, + volumes.name, + volumes.device_id, + volumes.volume_type, + volumes.provisioning_type, + volumes.size, + volumes.min_iops, + volumes.max_iops, + volumes.created, + volumes.state, + volumes.attached, + volumes.removed, + volumes.pod_id, + volumes.display_volume, + volumes.format, + volumes.path, + volumes.chain_info, + account.id account_id, + account.uuid account_uuid, + account.account_name account_name, + account.type account_type, + domain.id domain_id, + domain.uuid domain_uuid, + domain.name domain_name, + domain.path domain_path, + projects.id project_id, + projects.uuid project_uuid, + projects.name project_name, + data_center.id data_center_id, + data_center.uuid data_center_uuid, + data_center.name data_center_name, + data_center.networktype data_center_type, + vm_instance.id vm_id, + vm_instance.uuid vm_uuid, + vm_instance.name vm_name, + vm_instance.state vm_state, + vm_instance.vm_type, + user_vm.display_name vm_display_name, + volume_store_ref.size volume_store_size, + volume_store_ref.download_pct, + volume_store_ref.download_state, + volume_store_ref.error_str, + volume_store_ref.created created_on_store, + disk_offering.id disk_offering_id, + disk_offering.uuid disk_offering_uuid, + disk_offering.name disk_offering_name, + disk_offering.display_text disk_offering_display_text, + disk_offering.use_local_storage, + disk_offering.system_use, + disk_offering.bytes_read_rate, + disk_offering.bytes_write_rate, + disk_offering.iops_read_rate, + disk_offering.iops_write_rate, + disk_offering.cache_mode, + storage_pool.id pool_id, + storage_pool.uuid pool_uuid, + storage_pool.name pool_name, + cluster.hypervisor_type, + vm_template.id template_id, + vm_template.uuid template_uuid, + vm_template.extractable, + vm_template.type template_type, + vm_template.name template_name, + vm_template.display_text template_display_text, + iso.id iso_id, + iso.uuid iso_uuid, + iso.name iso_name, + iso.display_text iso_display_text, + resource_tags.id tag_id, + resource_tags.uuid tag_uuid, + resource_tags.key tag_key, + resource_tags.value tag_value, + resource_tags.domain_id tag_domain_id, + resource_tags.account_id tag_account_id, + resource_tags.resource_id tag_resource_id, + resource_tags.resource_uuid tag_resource_uuid, + resource_tags.resource_type tag_resource_type, + resource_tags.customer tag_customer, + async_job.id job_id, + async_job.uuid job_uuid, + async_job.job_status job_status, + async_job.account_id job_account_id + from + `cloud`.`volumes` + inner join + `cloud`.`account` ON volumes.account_id = account.id + inner join + `cloud`.`domain` ON volumes.domain_id = domain.id + left join + `cloud`.`projects` ON projects.project_account_id = account.id + left join + `cloud`.`data_center` ON volumes.data_center_id = data_center.id + left join + `cloud`.`vm_instance` ON volumes.instance_id = vm_instance.id + left join + `cloud`.`user_vm` ON user_vm.id = vm_instance.id + left join + `cloud`.`volume_store_ref` ON volumes.id = volume_store_ref.volume_id + left join + `cloud`.`disk_offering` ON volumes.disk_offering_id = disk_offering.id + left join + `cloud`.`storage_pool` ON volumes.pool_id = storage_pool.id + left join + `cloud`.`cluster` ON storage_pool.cluster_id = cluster.id + left join + `cloud`.`vm_template` ON volumes.template_id = vm_template.id + left join + `cloud`.`vm_template` iso ON iso.id = volumes.iso_id + left join + `cloud`.`resource_tags` ON resource_tags.resource_id = volumes.id + and resource_tags.resource_type = 'Volume' + left join + `cloud`.`async_job` ON async_job.instance_id = volumes.id + and async_job.instance_type = 'Volume' + and async_job.job_status = 0; + +CREATE TABLE `cloud`.`external_brocade_vcs_devices` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', + `uuid` varchar(255) UNIQUE, + `physical_network_id` bigint unsigned NOT NULL COMMENT 'id of the physical network in to which brocade vcs switch is added', + `provider_name` varchar(255) NOT NULL COMMENT 'Service Provider name corresponding to this brocade vcs switch', + `device_name` varchar(255) NOT NULL COMMENT 'name of the brocade vcs switch', + `host_id` bigint unsigned NOT NULL COMMENT 'host id coresponding to the external brocade vcs switch', + PRIMARY KEY (`id`), + CONSTRAINT `fk_external_brocade_vcs_devices__host_id` FOREIGN KEY (`host_id`) REFERENCES `host`(`id`) ON DELETE CASCADE, + CONSTRAINT `fk_external_brocade_vcs_devices__physical_network_id` FOREIGN KEY (`physical_network_id`) REFERENCES `physical_network`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`brocade_network_vlan_map` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', + `network_id` bigint unsigned NOT NULL COMMENT 'id of the network', + `vlan_id` int(10) COMMENT 'vlan id of the network', + PRIMARY KEY (`id`), + CONSTRAINT `fk_brocade_network_vlan_map__network_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +/* As part of the separation of Xen and XenServer, update the column for the network labels */ +ALTER TABLE `cloud`.`physical_network_traffic_types` CHANGE `xen_network_label` `xenserver_network_label` varchar(255) COMMENT 'The network name label of the physical device dedicated to this traffic on a XenServer host'; + +/*Adding domainId field to the user table in order to restrict duplicated users creation on the db level*/ +ALTER TABLE `cloud`.`user` ADD COLUMN domain_id bigint(20) unsigned DEFAULT NULL; +ALTER TABLE `cloud`.`user` ADD CONSTRAINT `fk_user__domain_id` FOREIGN KEY `fk_user__domain_id`(`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE; +UPDATE `cloud`.`user` SET `cloud`.`user`.domain_id=(SELECT `cloud`.`account`.domain_id FROM `cloud`.`account` WHERE `cloud`.`account`.id=`cloud`.`user`.account_id) where id > 0; +ALTER TABLE `cloud`.`user` ADD UNIQUE KEY `username_domain_id` (`username`,`domain_id`); + +ALTER TABLE `cloud`.`volumes` CHANGE COLUMN `iso_id` `iso_id` bigint(20) unsigned COMMENT 'The id of the iso from which the volume was created'; + +DROP VIEW IF EXISTS `cloud`.`storage_pool_view`; +CREATE VIEW `cloud`.`storage_pool_view` AS + select + storage_pool.id, + storage_pool.uuid, + storage_pool.name, + storage_pool.status, + storage_pool.path, + storage_pool.pool_type, + storage_pool.host_address, + storage_pool.created, + storage_pool.removed, + storage_pool.capacity_bytes, + storage_pool.capacity_iops, + storage_pool.scope, + storage_pool.hypervisor, + storage_pool.storage_provider_name, + cluster.id cluster_id, + cluster.uuid cluster_uuid, + cluster.name cluster_name, + cluster.cluster_type, + data_center.id data_center_id, + data_center.uuid data_center_uuid, + data_center.name data_center_name, + data_center.networktype data_center_type, + host_pod_ref.id pod_id, + host_pod_ref.uuid pod_uuid, + host_pod_ref.name pod_name, + storage_pool_details.name tag, + op_host_capacity.used_capacity disk_used_capacity, + op_host_capacity.reserved_capacity disk_reserved_capacity, + async_job.id job_id, + async_job.uuid job_uuid, + async_job.job_status job_status, + async_job.account_id job_account_id + from + `cloud`.`storage_pool` + left join + `cloud`.`cluster` ON storage_pool.cluster_id = cluster.id + left join + `cloud`.`data_center` ON storage_pool.data_center_id = data_center.id + left join + `cloud`.`host_pod_ref` ON storage_pool.pod_id = host_pod_ref.id + left join + `cloud`.`storage_pool_details` ON storage_pool_details.pool_id = storage_pool.id + and storage_pool_details.value = 'true' + left join + `cloud`.`op_host_capacity` ON storage_pool.id = op_host_capacity.host_id + and op_host_capacity.capacity_type in (3,9) + left join + `cloud`.`async_job` ON async_job.instance_id = storage_pool.id + and async_job.instance_type = 'StoragePool' + and async_job.job_status = 0; + + +DROP VIEW IF EXISTS `cloud`.`template_view`; +CREATE VIEW `cloud`.`template_view` AS + select + vm_template.id, + vm_template.uuid, + vm_template.unique_name, + vm_template.name, + vm_template.public, + vm_template.featured, + vm_template.type, + vm_template.hvm, + vm_template.bits, + vm_template.url, + vm_template.format, + vm_template.created, + vm_template.checksum, + vm_template.display_text, + vm_template.enable_password, + vm_template.dynamically_scalable, + vm_template.state template_state, + vm_template.guest_os_id, + guest_os.uuid guest_os_uuid, + guest_os.display_name guest_os_name, + vm_template.bootable, + vm_template.prepopulate, + vm_template.cross_zones, + vm_template.hypervisor_type, + vm_template.extractable, + vm_template.template_tag, + vm_template.sort_key, + vm_template.removed, + vm_template.enable_sshkey, + source_template.id source_template_id, + source_template.uuid source_template_uuid, + account.id account_id, + account.uuid account_uuid, + account.account_name account_name, + account.type account_type, + domain.id domain_id, + domain.uuid domain_uuid, + domain.name domain_name, + domain.path domain_path, + projects.id project_id, + projects.uuid project_uuid, + projects.name project_name, + data_center.id data_center_id, + data_center.uuid data_center_uuid, + data_center.name data_center_name, + launch_permission.account_id lp_account_id, + template_store_ref.store_id, + image_store.scope as store_scope, + template_store_ref.state, + template_store_ref.download_state, + template_store_ref.download_pct, + template_store_ref.error_str, + template_store_ref.size, + template_store_ref.destroyed, + template_store_ref.created created_on_store, + vm_template_details.name detail_name, + vm_template_details.value detail_value, + resource_tags.id tag_id, + resource_tags.uuid tag_uuid, + resource_tags.key tag_key, + resource_tags.value tag_value, + resource_tags.domain_id tag_domain_id, + resource_tags.account_id tag_account_id, + resource_tags.resource_id tag_resource_id, + resource_tags.resource_uuid tag_resource_uuid, + resource_tags.resource_type tag_resource_type, + resource_tags.customer tag_customer, + CONCAT(vm_template.id, '_', IFNULL(data_center.id, 0)) as temp_zone_pair + from + `cloud`.`vm_template` + inner join + `cloud`.`guest_os` ON guest_os.id = vm_template.guest_os_id + inner join + `cloud`.`account` ON account.id = vm_template.account_id + inner join + `cloud`.`domain` ON domain.id = account.domain_id + left join + `cloud`.`projects` ON projects.project_account_id = account.id + left join + `cloud`.`vm_template_details` ON vm_template_details.template_id = vm_template.id + left join + `cloud`.`vm_template` source_template ON source_template.id = vm_template.source_template_id + left join + `cloud`.`template_store_ref` ON template_store_ref.template_id = vm_template.id and template_store_ref.store_role = 'Image' and template_store_ref.destroyed=0 + left join + `cloud`.`image_store` ON image_store.removed is NULL AND template_store_ref.store_id is not NULL AND image_store.id = template_store_ref.store_id + left join + `cloud`.`template_zone_ref` ON template_zone_ref.template_id = vm_template.id AND template_store_ref.store_id is NULL AND template_zone_ref.removed is null + left join + `cloud`.`data_center` ON (image_store.data_center_id = data_center.id OR template_zone_ref.zone_id = data_center.id) + left join + `cloud`.`launch_permission` ON launch_permission.template_id = vm_template.id + left join + `cloud`.`resource_tags` ON resource_tags.resource_id = vm_template.id + and (resource_tags.resource_type = 'Template' or resource_tags.resource_type='ISO'); +