Update version, try fixing all possible broken states, refs #742

Signed-off-by: Florian Aders (EleRas) <eleras@froxlor.org>
This commit is contained in:
Florian Aders (EleRas)
2011-04-28 09:47:22 +02:00
parent 3fb6d4eac9
commit e148e7d584
2 changed files with 44 additions and 1 deletions

View File

@@ -1542,3 +1542,46 @@ if(isFroxlorVersion('0.9.20'))
updateToVersion('0.9.20.1');
}
if(isFroxlorVersion('0.9.20.1'))
{
showUpdateStep("Updating from 0.9.20.1 to 0.9.20.1-svn1");
lastStepStatus(0);
showUpdateStep("Fixing possible broken tables");
// The customer-table may miss the columns, if installed a fresh 0.9.20 or 0.9.20.1 - add them
$result = $db->query("DESCRIBE `" . TABLE_PANEL_CUSTOMERS . "`");
$columnfound = 0;
while($row = $db->fetch_array($result))
{
if($row['Field'] == 'backup_allowed')
{
$columnfound = 1;
}
}
if (!$columnfound)
{
$db->query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `backup_allowed` TINYINT( 1 ) NOT NULL DEFAULT '1'");
$db->query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `backup_enabled` TINYINT( 1 ) NOT NULL DEFAULT '0'");
}
// The admin-table may have the columns, if installed a fresh 0.9.20.1 - remove them
$result = $db->query("DESCRIBE `" . TABLE_PANEL_ADMINS . "`");
$columnfound = 0;
while($row = $db->fetch_array($result))
{
if($row['Field'] == 'backup_allowed')
{
$columnfound = 1;
}
}
if ($columnfound)
{
$db->query("ALTER TABLE `" . TABLE_PANEL_ADMINS . "` DROP `backup_allowed`;");
$db->query("ALTER TABLE `" . TABLE_PANEL_ADMINS . "` DROP `backup_enabled`;");
}
lastStepStatus(0);
updateToVersion('0.9.20.1-svn1');
}

View File

@@ -73,6 +73,6 @@ define('PACKAGE_ENABLED', 2);
// VERSION INFO
$version = '0.9.20.1';
$version = '0.9.20.1-svn1';
$dbversion = '2';
$branding = '';