2015-06-27 19:03:27 +00:00
|
|
|
<?php
|
|
|
|
|
2016-01-30 20:43:57 +00:00
|
|
|
/**
|
|
|
|
* Update to version 3.0.3
|
|
|
|
*/
|
2015-06-27 19:03:27 +00:00
|
|
|
|
2016-01-30 22:07:59 +00:00
|
|
|
use Lychee\Modules\Database;
|
2016-02-14 13:26:05 +00:00
|
|
|
use Lychee\Modules\Response;
|
2015-06-27 19:03:27 +00:00
|
|
|
|
2016-01-30 20:43:57 +00:00
|
|
|
// Add skipDuplicates to settings
|
|
|
|
$query = Database::prepare($connection, "SELECT `key` FROM `?` WHERE `key` = 'skipDuplicates' LIMIT 1", array(LYCHEE_TABLE_SETTINGS));
|
2016-01-31 17:49:31 +00:00
|
|
|
$result = Database::execute($connection, $query, 'update_030003', __LINE__);
|
|
|
|
|
2016-02-14 13:26:05 +00:00
|
|
|
if ($result===false) Response::error('Could not get current skipDuplicates from database!');
|
2016-01-31 17:49:31 +00:00
|
|
|
|
2015-06-27 19:03:27 +00:00
|
|
|
if ($result->num_rows===0) {
|
2016-01-31 17:49:31 +00:00
|
|
|
|
2016-01-30 20:43:57 +00:00
|
|
|
$query = Database::prepare($connection, "INSERT INTO `?` (`key`, `value`) VALUES ('skipDuplicates', '0')", array(LYCHEE_TABLE_SETTINGS));
|
2016-01-31 17:49:31 +00:00
|
|
|
$result = Database::execute($connection, $query, 'update_030003', __LINE__);
|
|
|
|
|
2016-02-14 13:26:05 +00:00
|
|
|
if ($result===false) Response::error('Could not add skipDuplicates to database!');
|
2016-01-31 17:49:31 +00:00
|
|
|
|
2015-06-27 19:03:27 +00:00
|
|
|
}
|
|
|
|
|
2016-01-30 20:43:57 +00:00
|
|
|
// Set version
|
2016-02-14 13:26:05 +00:00
|
|
|
if (Database::setVersion($connection, '030003')===false) Response::error('Could not update version of database!');
|
2015-06-27 19:03:27 +00:00
|
|
|
|
|
|
|
?>
|