Removed database updates for versions <= 2.5.0

This commit is contained in:
Tobias Reich 2016-01-24 16:51:09 +01:00
parent 61c13e36a0
commit 9e52f93a59
4 changed files with 0 additions and 90 deletions

View File

@ -1,44 +0,0 @@
<?php
###
# @name Update to version 2.1
# @copyright 2015 by Tobias Reich
###
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
$query = Database::prepare($database, "SELECT `tags` FROM `?` LIMIT 1", array(LYCHEE_TABLE_PHOTOS));
if(!$database->query($query)) {
$query = Database::prepare($database, "ALTER TABLE `?` ADD `tags` VARCHAR( 1000 ) NULL DEFAULT ''", array(LYCHEE_TABLE_PHOTOS));
$result = $database->query($query);
if (!$result) {
Log::error($database, 'update_020100', __LINE__, 'Could not update database (' . $database->error . ')');
return false;
}
}
$query = Database::prepare($database, "SELECT `key` FROM `?` WHERE `key` = 'dropboxKey' LIMIT 1", array(LYCHEE_TABLE_SETTINGS));
$result = $database->query($query);
if ($result->num_rows===0) {
$query = Database::prepare($database, "INSERT INTO `?` (`key`, `value`) VALUES ('dropboxKey', '')", array(LYCHEE_TABLE_SETTINGS));
$result = $database->query($query);
if (!$result) {
Log::error($database, 'update_020100', __LINE__, 'Could not update database (' . $database->error . ')');
return false;
}
}
$query = Database::prepare($database, "SELECT `key` FROM `?` WHERE `key` = 'version' LIMIT 1", array(LYCHEE_TABLE_SETTINGS));
$result = $database->query($query);
if ($result->num_rows===0) {
$query = Database::prepare($database, "INSERT INTO `?` (`key`, `value`) VALUES ('version', '020100')", array(LYCHEE_TABLE_SETTINGS));
$result = $database->query($query);
if (!$result) {
Log::error($database, 'update_020100', __LINE__, 'Could not update database (' . $database->error . ')');
return false;
}
} else {
if (Database::setVersion($database, '020100')===false) return false;
}
?>

View File

@ -1,20 +0,0 @@
<?php
###
# @name Update to version 2.1.1
# @copyright 2015 by Tobias Reich
###
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
$query = Database::prepare($database, "ALTER TABLE `?` CHANGE `value` `value` VARCHAR( 200 ) NULL DEFAULT ''", array(LYCHEE_TABLE_SETTINGS));
$result = $database->query($query);
if (!$result) {
Log::error($database, 'update_020101', __LINE__, 'Could not update database (' . $database->error . ')');
return false;
}
# Set version
if (Database::setVersion($database, '020101')===false) return false;
?>

View File

@ -1,23 +0,0 @@
<?php
###
# @name Update to version 2.2
# @copyright 2015 by Tobias Reich
###
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
$query = Database::prepare($database, "SELECT `visible` FROM `?` LIMIT 1", array(LYCHEE_TABLE_ALBUMS));
if (!$database->query($query)) {
$query = Database::prepare($database, "ALTER TABLE `?` ADD `visible` TINYINT(1) NOT NULL DEFAULT 1", array(LYCHEE_TABLE_ALBUMS));
$result = $database->query($query);
if (!$result) {
Log::error($database, 'update_020200', __LINE__, 'Could not update database (' . $database->error . ')');
return false;
}
}
# Set version
if (Database::setVersion($database, '020200')===false) return false;
?>

View File

@ -10,9 +10,6 @@ if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
final class Database extends Module {
private static $versions = array(
'020100', #2.1
'020101', #2.1.1
'020200', #2.2
'020500', #2.5
'020505', #2.5.5
'020601', #2.6.1