Updated Branches:
  refs/heads/master 03fac8318 -> d7a7c0905

CLOUDSTACK-3648: 3.0.6 to ASF 4.2 Upgrade: "hypervisor_capabilites" table has 
duplicate VMware 5.1 entries on the Upgraded Setup
Added a unique constraint on "hypervisor_capabilities" table based on 
hypervisor type and version


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

Branch: refs/heads/master
Commit: d7a7c090556e5718a876acf1b07a91febf37fea3
Parents: 03fac83
Author: Koushik Das <[email protected]>
Authored: Fri Jul 19 12:12:51 2013 +0530
Committer: Koushik Das <[email protected]>
Committed: Fri Jul 19 12:12:51 2013 +0530

----------------------------------------------------------------------
 setup/db/db/schema-410to420.sql | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d7a7c090/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index c8ec726..47fd4bd 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -22,6 +22,9 @@
 -- Disable foreign key checking
 SET foreign_key_checks = 0;
 
+-- All new inserts to the hypervisor_capabilities table should be after this
+ALTER TABLE `cloud`.`hypervisor_capabilities` ADD CONSTRAINT `uc_hypervisor` 
UNIQUE (`hypervisor_type`, `hypervisor_version`);
+
 ALTER TABLE `cloud`.`hypervisor_capabilities` ADD COLUMN 
`max_hosts_per_cluster` int unsigned DEFAULT NULL COMMENT 'Max. hosts in 
cluster supported by hypervisor';
 ALTER TABLE `cloud`.`hypervisor_capabilities` ADD COLUMN 
`storage_motion_supported` int(1) unsigned DEFAULT 0 COMMENT 'Is storage motion 
supported';
 UPDATE `cloud`.`hypervisor_capabilities` SET `max_hosts_per_cluster`=32 WHERE 
`hypervisor_type`='VMware';

Reply via email to