You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
843 B
29 lines
843 B
8 years ago
|
<?php
|
||
|
|
||
|
/**
|
||
8 years ago
|
* Update to version 3.2.0
|
||
8 years ago
|
*/
|
||
|
|
||
|
use Lychee\Modules\Database;
|
||
|
use Lychee\Modules\Response;
|
||
|
|
||
|
// Add parent field to albums
|
||
8 years ago
|
$query = Database::prepare($connection, "SELECT `parent` FROM `?` LIMIT 1", array(LYCHEE_TABLE_ALBUMS));
|
||
8 years ago
|
$result = Database::execute($connection, $query, "update_030200", __LINE__);
|
||
8 years ago
|
|
||
|
if ($result===false) {
|
||
|
|
||
|
$query = Database::prepare($connection, "ALTER TABLE `?` ADD `parent` BIGINT(14) NOT NULL DEFAULT 0", array(LYCHEE_TABLE_ALBUMS));
|
||
8 years ago
|
$result = Database::execute($connection, $query, "update_030200", __LINE__);
|
||
8 years ago
|
|
||
|
if ($result===false) {
|
||
8 years ago
|
Log::error($database, 'update_030200', __LINE__, 'Could not update database (' . $database->error . ')');
|
||
8 years ago
|
return false;
|
||
|
}
|
||
|
|
||
8 years ago
|
}
|
||
|
|
||
|
// Set version
|
||
8 years ago
|
// if (Database::setVersion($connection, '030200')===false) Response::error('Could not update version of database!');
|
||
8 years ago
|
|
||
|
?>
|