2015-06-27 19:03:27 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
###
|
|
|
|
# @name Update to version 3.0.3
|
|
|
|
# @copyright 2015 by Tobias Reich
|
|
|
|
###
|
|
|
|
|
|
|
|
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
|
|
|
|
|
|
|
|
# Add skipDuplicates to settings
|
2016-01-24 21:14:20 +00:00
|
|
|
$query = Database::prepare($connection, "SELECT `key` FROM `?` WHERE `key` = 'skipDuplicates' LIMIT 1", array(LYCHEE_TABLE_SETTINGS));
|
|
|
|
$result = $connection->query($query);
|
2015-06-27 19:03:27 +00:00
|
|
|
if ($result->num_rows===0) {
|
2016-01-24 21:14:20 +00:00
|
|
|
$query = Database::prepare($connection, "INSERT INTO `?` (`key`, `value`) VALUES ('skipDuplicates', '0')", array(LYCHEE_TABLE_SETTINGS));
|
|
|
|
$result = $connection->query($query);
|
2015-06-27 19:03:27 +00:00
|
|
|
if (!$result) {
|
2016-01-24 21:14:20 +00:00
|
|
|
Log::error('update_030003', __LINE__, 'Could not update database (' . $connection->error . ')');
|
2015-06-27 19:03:27 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Set version
|
2016-01-24 21:14:20 +00:00
|
|
|
if (Database::setVersion($connection, '030003')===false) return false;
|
2015-06-27 19:03:27 +00:00
|
|
|
|
|
|
|
?>
|