update_020505.php 637 B

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