update_020505.php 708 B

123456789101112131415161718192021222324
  1. <?php
  2. ###
  3. # @name Update to version 2.5.5
  4. # @copyright 2015 by Tobias Reich
  5. ###
  6. if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
  7. # Add `checksum`
  8. $query = Database::prepare($database, "SELECT `checksum` FROM `?` LIMIT 1", array(LYCHEE_TABLE_PHOTOS));
  9. if (!$database->query($query)) {
  10. $query = Database::prepare($database, "ALTER TABLE `?` ADD `checksum` VARCHAR(100) DEFAULT NULL", array(LYCHEE_TABLE_PHOTOS));
  11. $result = $database->query($query);
  12. if (!$result) {
  13. Log::error($database, 'update_020505', __LINE__, 'Could not update database (' . $database->error . ')');
  14. return false;
  15. }
  16. }
  17. # Set version
  18. if (Database::setVersion($database, '020505')===false) return false;
  19. ?>