update_020505.php 706 B

12345678910111213141516171819202122232425
  1. <?php
  2. ###
  3. # @name Update to version 2.5.5
  4. # @author Tobias Reich
  5. # @copyright 2014 by Tobias Reich
  6. ###
  7. # Add `checksum`
  8. if (!$database->query("SELECT `checksum` FROM `lychee_photos` LIMIT 1;")) {
  9. $result = $database->query("ALTER TABLE `lychee_photos` ADD `checksum` VARCHAR(100) DEFAULT NULL");
  10. if (!$result) {
  11. Log::error($database, 'update_020505', __LINE__, 'Could not update database (' . $database->error . ')');
  12. return false;
  13. }
  14. }
  15. # Set version
  16. $result = $database->query("UPDATE lychee_settings SET value = '020505' WHERE `key` = 'version';");
  17. if (!$result) {
  18. Log::error($database, 'update_020505', __LINE__, 'Could not update database (' . $database->error . ')');
  19. return false;
  20. }
  21. ?>