You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2012/12/21 21:53:31 UTC

[5/9] git commit: Update DB version during DB deploy 1. Modified create-schema.sql to add version as 4.1.0 instead of 4.0.0 2. Removed schema-40to41.sql amd moved the content to schema-40to410.sql 3. Added to schema-40to410.sql Upgrade40to41.java

Update DB version during DB deploy
	1. Modified create-schema.sql to add version as 4.1.0 instead of 4.0.0
	2. Removed schema-40to41.sql amd moved the content to schema-40to410.sql
	3. Added to schema-40to410.sql Upgrade40to41.java


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

Branch: refs/heads/ui-plugins
Commit: 8acc85ca5371d8fb3c66ac4083633849422f5654
Parents: d72f8a6
Author: Kishan Kavala <ki...@cloud.com>
Authored: Fri Dec 21 15:27:00 2012 +0530
Committer: Kishan Kavala <ki...@cloud.com>
Committed: Fri Dec 21 15:27:00 2012 +0530

----------------------------------------------------------------------
 .../src/com/cloud/upgrade/dao/Upgrade40to41.java   |   10 +++++-
 setup/db/create-schema.sql                         |    2 +-
 setup/db/db/schema-40to41.sql                      |   25 ---------------
 setup/db/db/schema-40to410.sql                     |    4 ++
 4 files changed, 13 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/8acc85ca/server/src/com/cloud/upgrade/dao/Upgrade40to41.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/upgrade/dao/Upgrade40to41.java b/server/src/com/cloud/upgrade/dao/Upgrade40to41.java
index 393aefd..cfb783b 100644
--- a/server/src/com/cloud/upgrade/dao/Upgrade40to41.java
+++ b/server/src/com/cloud/upgrade/dao/Upgrade40to41.java
@@ -18,6 +18,7 @@
 package com.cloud.upgrade.dao;
 
 import com.cloud.utils.exception.CloudRuntimeException;
+import com.cloud.utils.script.Script;
 
 import java.io.File;
 import java.sql.Connection;
@@ -29,7 +30,7 @@ import java.sql.SQLException;
  * @author htrippaers
  *
  */
-public class Upgrade40to41 extends Upgrade30xBase implements DbUpgrade {
+public class Upgrade40to41 implements DbUpgrade {
 
 	/**
 	 * 
@@ -67,7 +68,12 @@ public class Upgrade40to41 extends Upgrade30xBase implements DbUpgrade {
 	 */
 	@Override
 	public File[] getPrepareScripts() {
-		return new File[0];
+		String script = Script.findScript("", "db/schema-40to410.sql");
+        if (script == null) {
+            throw new CloudRuntimeException("Unable to find db/schema-40to410.sql");
+        }
+        
+        return new File[] { new File(script) };
 	}
 
 	/* (non-Javadoc)

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/8acc85ca/setup/db/create-schema.sql
----------------------------------------------------------------------
diff --git a/setup/db/create-schema.sql b/setup/db/create-schema.sql
index 8010e3b..1b6ee5d 100755
--- a/setup/db/create-schema.sql
+++ b/setup/db/create-schema.sql
@@ -166,7 +166,7 @@ CREATE TABLE `cloud`.`version` (
   INDEX `i_version__version`(`version`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
-INSERT INTO `version` (`version`, `updated`, `step`) VALUES('4.0.0.2012-09-12T14:47:37Z', now(), 'Complete');
+INSERT INTO `version` (`version`, `updated`, `step`) VALUES('4.1.0', now(), 'Complete');
 
 CREATE TABLE `cloud`.`op_it_work` (
   `id` char(40) COMMENT 'reservation id',

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/8acc85ca/setup/db/db/schema-40to41.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-40to41.sql b/setup/db/db/schema-40to41.sql
deleted file mode 100644
index 61cb4a2..0000000
--- a/setup/db/db/schema-40to41.sql
+++ /dev/null
@@ -1,25 +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.0 to 4.1.0;
---;
-
-
-ALTER TABLE `cloud`.`network_offerings` ADD COLUMN `eip_associate_public_ip` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if public IP is associated with user VM creation by default when EIP service is enabled.' AFTER `elastic_ip_service`;
-
-INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network','DEFAULT','NetworkManager','network.dhcp.nondefaultnetwork.setgateway.guestos','Windows','The guest OS\'s name start with this fields would result in DHCP server response gateway information even when the network it\'s on is not default network. Names are separated by comma.');

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/8acc85ca/setup/db/db/schema-40to410.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-40to410.sql b/setup/db/db/schema-40to410.sql
index b0301d7..73289bc 100644
--- a/setup/db/db/schema-40to410.sql
+++ b/setup/db/db/schema-40to410.sql
@@ -56,3 +56,7 @@ ALTER TABLE `cloud`.`snapshots` ADD COLUMN `s3_id` bigint unsigned COMMENT 'S3 t
 
 ALTER TABLE `cloud`.`snapshots` ADD CONSTRAINT `fk_snapshots__s3_id` FOREIGN KEY `fk_snapshots__s3_id` (`s3_id`) REFERENCES `s3` (`id`);
 
+ALTER TABLE `cloud`.`network_offerings` ADD COLUMN `eip_associate_public_ip` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if public IP is associated with user VM creation by default when EIP service is enabled.' AFTER `elastic_ip_service`;
+
+INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network','DEFAULT','NetworkManager','network.dhcp.nondefaultnetwork.setgateway.guestos','Windows','The guest OS\'s name start with this fields would result in DHCP server response gateway information even when the network it\'s on is not default network. Names are separated by comma.');
+