Version push and add checksum for existing users #179

This commit is contained in:
Tobias Reich 2014-07-05 00:39:31 +02:00
parent ba852f8a03
commit c064c1c0e4
7 changed files with 32 additions and 14 deletions

View File

@ -8,8 +8,8 @@
var lychee = {
title: "",
version: "2.5",
version_code: "020500",
version: "2.5.5",
version_code: "020505",
api_path: "php/api.php",
update_path: "http://lychee.electerious.com/version/index.php",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -23,5 +23,6 @@ CREATE TABLE IF NOT EXISTS `lychee_photos` (
`star` tinyint(1) NOT NULL,
`thumbUrl` varchar(50) NOT NULL,
`album` varchar(30) NOT NULL DEFAULT '0',
`checksum` VARCHAR(100) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

View File

@ -116,15 +116,6 @@ if (!$result) {
return false;
}
# Add `checksum`
if (!$database->query("SELECT `checksum` FROM `lychee_photos` LIMIT 1;")) {
$result = $database->query("ALTER TABLE `lychee_photos` ADD `checksum` VARCHAR(100) DEFAULT NULL");
if (!$result) {
Log::error($database, 'update_020500', __LINE__, 'Could not update database (' . $database->error . ')');
return false;
}
}
# Reset sorting
$result = $database->query("UPDATE lychee_settings SET value = 'ORDER BY takestamp DESC' WHERE `key` = 'sorting' AND `value` LIKE '%UNIX_TIMESTAMP%';");
if (!$result) {

View File

@ -0,0 +1,25 @@
<?php
###
# @name Update to version 2.5.5
# @author Tobias Reich
# @copyright 2014 by Tobias Reich
###
# Add `checksum`
if (!$database->query("SELECT `checksum` FROM `lychee_photos` LIMIT 1;")) {
$result = $database->query("ALTER TABLE `lychee_photos` ADD `checksum` VARCHAR(100) DEFAULT NULL");
if (!$result) {
Log::error($database, 'update_020500', __LINE__, 'Could not update database (' . $database->error . ')');
return false;
}
}
# Set version
$result = $database->query("UPDATE lychee_settings SET value = '020505' WHERE `key` = 'version';");
if (!$result) {
Log::error($database, 'update_020505', __LINE__, 'Could not update database (' . $database->error . ')');
return false;
}
?>

View File

@ -46,7 +46,8 @@ class Database extends Module {
'020100', #2.1
'020101', #2.1.1
'020200', #2.2
'020500' #2.5
'020500', #2.5
'020505' #2.5.5
);
# For each update