From 891d222a334f342150ca5a5fc82736e082675657 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sat, 31 May 2014 12:06:26 +0200 Subject: [PATCH] Added Log to update_020100 --- php/database/update_020100.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/php/database/update_020100.php b/php/database/update_020100.php index c0955a4..ccb6d9d 100644 --- a/php/database/update_020100.php +++ b/php/database/update_020100.php @@ -8,22 +8,34 @@ if(!$database->query("SELECT `tags` FROM `lychee_photos` LIMIT 1;")) { $result = $database->query("ALTER TABLE `lychee_photos` ADD `tags` VARCHAR( 1000 ) NULL DEFAULT ''"); - if (!$result) return false; + if (!$result) { + Log::error($database, 'update_020100', __LINE__, 'Could not update database (' . $database->error . ')'); + return false; + } } $result = $database->query("SELECT `key` FROM `lychee_settings` WHERE `key` = 'dropboxKey' LIMIT 1;"); if ($result->num_rows===0) { $result = $database->query("INSERT INTO `lychee_settings` (`key`, `value`) VALUES ('dropboxKey', '')"); - if (!$result) return false; + if (!$result) { + Log::error($database, 'update_020100', __LINE__, 'Could not update database (' . $database->error . ')'); + return false; + } } $result = $database->query("SELECT `key` FROM `lychee_settings` WHERE `key` = 'version' LIMIT 1;"); if ($result->num_rows===0) { $result = $database->query("INSERT INTO `lychee_settings` (`key`, `value`) VALUES ('version', '020100')"); - if (!$result) return false; + if (!$result) { + Log::error($database, 'update_020100', __LINE__, 'Could not update database (' . $database->error . ')'); + return false; + } } else { $result = $database->query("UPDATE lychee_settings SET value = '020100' WHERE `key` = 'version';"); - if (!$result) return false; + if (!$result) { + Log::error($database, 'update_020100', __LINE__, 'Could not update database (' . $database->error . ')'); + return false; + } } ?> \ No newline at end of file