incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kis...@apache.org
Subject 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
Date Fri, 21 Dec 2012 09:57:43 GMT
Updated Branches:
  refs/heads/master d72f8a695 -> 8acc85ca5


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/master
Commit: 8acc85ca5371d8fb3c66ac4083633849422f5654
Parents: d72f8a6
Author: Kishan Kavala <kishan@cloud.com>
Authored: Fri Dec 21 15:27:00 2012 +0530
Committer: Kishan Kavala <kishan@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.');
+


Mime
View raw message