Added basic subalbum support.
That is, albums can now contain other albums, which are shown at
the top of the album view. This required some changes to album.js
and the contextMenu.js, because this view contains now both
photos and albums.
The contextMenu on this view has been kept simple by requiring
the user to select either only albums or only photos, but not
a mixture of both.
This feature required a database change, so that the version
has been updated to 3.1.3.
At the moment, album and photo operations (make public, download,
delete, merge) are still "flat", i.e. don't respect the album
hierarchy.
2016-07-28 14:01:36 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update to version 3.1.3
|
|
|
|
*/
|
|
|
|
|
|
|
|
use Lychee\Modules\Database;
|
|
|
|
use Lychee\Modules\Response;
|
|
|
|
|
|
|
|
// Add parent field to albums
|
2016-07-31 13:53:34 +00:00
|
|
|
$query = Database::prepare($connection, "SELECT `parent` FROM `?` LIMIT 1", array(LYCHEE_TABLE_ALBUMS));
|
|
|
|
$result = Database::execute($connection, $query, "update_030103", __LINE__);
|
|
|
|
|
|
|
|
if ($result===false) {
|
|
|
|
|
|
|
|
$query = Database::prepare($connection, "ALTER TABLE `?` ADD `parent` BIGINT(14) NOT NULL DEFAULT 0", array(LYCHEE_TABLE_ALBUMS));
|
|
|
|
$result = Database::execute($connection, $query, "update_030103", __LINE__);
|
|
|
|
|
|
|
|
if ($result===false) {
|
|
|
|
Log::error($database, 'update_030103', __LINE__, 'Could not update database (' . $database->error . ')');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
Added basic subalbum support.
That is, albums can now contain other albums, which are shown at
the top of the album view. This required some changes to album.js
and the contextMenu.js, because this view contains now both
photos and albums.
The contextMenu on this view has been kept simple by requiring
the user to select either only albums or only photos, but not
a mixture of both.
This feature required a database change, so that the version
has been updated to 3.1.3.
At the moment, album and photo operations (make public, download,
delete, merge) are still "flat", i.e. don't respect the album
hierarchy.
2016-07-28 14:01:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Set version
|
|
|
|
if (Database::setVersion($connection, '030103')===false) Response::error('Could not update version of database!');
|
|
|
|
|
|
|
|
?>
|