From b8a0b0333d891ef5e48140ed4ce104458aa4ae4d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Schneider?= <mail@jeromeschneider.fr>
Date: Sun, 7 Jul 2013 18:15:52 +0200
Subject: [PATCH] Updated upgrade script; Bumped version number from 0.2.4 to
 0.2.5

Former-commit-id: b03182e39c0c79d672385d34d3cf24e81d2f42c0
---
 Core/Distrib.php                                          | 2 +-
 .../BaikalAdmin/Controller/Install/VersionUpgrade.php     | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/Core/Distrib.php b/Core/Distrib.php
index 174ab58..dea15b4 100755
--- a/Core/Distrib.php
+++ b/Core/Distrib.php
@@ -24,6 +24,6 @@
 #  This copyright notice MUST APPEAR in all copies of the script!
 #################################################################
 
-define("BAIKAL_VERSION", "0.2.4");
+define("BAIKAL_VERSION", "0.2.5");
 define("BAIKAL_HOMEPAGE", "http://baikal-server.com");
 define("PROJECT_PACKAGE", "regular");
diff --git a/Core/Frameworks/BaikalAdmin/Controller/Install/VersionUpgrade.php b/Core/Frameworks/BaikalAdmin/Controller/Install/VersionUpgrade.php
index 9b65e11..6a19100 100755
--- a/Core/Frameworks/BaikalAdmin/Controller/Install/VersionUpgrade.php
+++ b/Core/Frameworks/BaikalAdmin/Controller/Install/VersionUpgrade.php
@@ -101,7 +101,7 @@ HTML;
 			}
 		}
 
-		if(version_compare($sVersionFrom, '2.3.0', '<=')) {
+		if(version_compare($sVersionFrom, '0.2.3', '<=')) {
 			# Upgrading DB
 
 			#	etag VARCHAR(32),
@@ -129,7 +129,7 @@ HTML;
 					"ALTER TABLE calendarobjects ADD COLUMN firstoccurence integer",
 					"ALTER TABLE calendarobjects ADD COLUMN lastoccurence integer",
 					"ALTER TABLE calendars ADD COLUMN transparent bool",
-					"ALTER TABLE principals ADD COLUMN vcardurl VARCHAR(80)",	# This one is added in SQLite but not MySQL, because it is already there since the beginning in MySQL
+					"ALTER TABLE principals ADD COLUMN vcardurl text",	# This one is added in SQLite but not MySQL, because it is already there since the beginning in MySQL
 				);
 
 				$this->aSuccess[] = "SQLite database has been successfuly upgraded.'";
@@ -145,6 +145,10 @@ HTML;
 				return FALSE;
 			}
 		}
+
+		if(version_compare($sVersionFrom, '0.2.4', '<=')) {
+			# Nothing to do :)
+		}
 		
 		$this->updateConfiguredVersion($sVersionTo);
 		return TRUE;