-
Notifications
You must be signed in to change notification settings - Fork 675
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #559 from electerious/develop
Lychee 3.1.2
- Loading branch information
Showing
12 changed files
with
170 additions
and
43 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?php | ||
|
||
/** | ||
* Update to version 3.1.2 | ||
*/ | ||
|
||
use Lychee\Modules\Database; | ||
use Lychee\Modules\Response; | ||
|
||
// Change type of the album id field | ||
$query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `album` `album` BIGINT(14) UNSIGNED NOT NULL", array(LYCHEE_TABLE_PHOTOS)); | ||
$result = Database::execute($connection, $query, 'update_030102', __LINE__); | ||
|
||
if ($result===false) Response::error('Could not change type of the album id field!'); | ||
|
||
// Add index to the album id field | ||
$query = Database::prepare($connection, "SHOW INDEX FROM `?` WHERE KEY_NAME = 'Index_album'", array(LYCHEE_TABLE_PHOTOS)); | ||
$result = Database::execute($connection, $query, 'update_030102', __LINE__); | ||
|
||
if ($result===false) Response::error('Could not check if Index_album exists!'); | ||
|
||
if ($result->num_rows===0) { | ||
|
||
$query = Database::prepare($connection, "ALTER TABLE `?` ADD INDEX `Index_album` (`album`)", array(LYCHEE_TABLE_PHOTOS)); | ||
$result = Database::execute($connection, $query, 'update_030102', __LINE__); | ||
|
||
if ($result===false) Response::error('Could not add index to the album id field!'); | ||
|
||
} | ||
|
||
// Add index to the star field | ||
$query = Database::prepare($connection, "SHOW INDEX FROM `?` WHERE KEY_NAME = 'Index_star'", array(LYCHEE_TABLE_PHOTOS)); | ||
$result = Database::execute($connection, $query, 'update_030102', __LINE__); | ||
|
||
if ($result===false) Response::error('Could not check if Index_star exists!'); | ||
|
||
if ($result->num_rows===0) { | ||
|
||
$query = Database::prepare($connection, "ALTER TABLE `?` ADD INDEX `Index_star` (`star`)", array(LYCHEE_TABLE_PHOTOS)); | ||
$result = Database::execute($connection, $query, 'update_030102', __LINE__); | ||
|
||
if ($result===false) Response::error('Could not add index to the star field!'); | ||
|
||
} | ||
|
||
// Change type of the checksum field | ||
$query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `checksum` `checksum` CHAR(40) NULL DEFAULT NULL", array(LYCHEE_TABLE_PHOTOS)); | ||
$result = Database::execute($connection, $query, 'update_030102', __LINE__); | ||
|
||
if ($result===false) Response::error('Could not change type of the checksum field!'); | ||
|
||
// Change type of the thumbUrl field | ||
$query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `thumbUrl` `thumbUrl` CHAR(37) NOT NULL", array(LYCHEE_TABLE_PHOTOS)); | ||
$result = Database::execute($connection, $query, 'update_030102', __LINE__); | ||
|
||
if ($result===false) Response::error('Could not change type of the thumbUrl field!'); | ||
|
||
// Change type of the id field | ||
$query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `id` `id` BIGINT(14) UNSIGNED NOT NULL", array(LYCHEE_TABLE_PHOTOS)); | ||
$result = Database::execute($connection, $query, 'update_030102', __LINE__); | ||
|
||
if ($result===false) Response::error('Could not change type of the id field!'); | ||
|
||
// Change type of the id field | ||
$query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `id` `id` BIGINT(14) UNSIGNED NOT NULL", array(LYCHEE_TABLE_ALBUMS)); | ||
$result = Database::execute($connection, $query, 'update_030102', __LINE__); | ||
|
||
if ($result===false) Response::error('Could not change type of the id field!'); | ||
|
||
// Set version | ||
if (Database::setVersion($connection, '030102')===false) Response::error('Could not update version of database!'); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "Lychee", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "Self-hosted photo-management done right.", | ||
"authors": "Tobias Reich <[email protected]>", | ||
"license": "MIT", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters