update_020200.php 675 B

1234567891011121314151617181920212223
  1. <?php
  2. ###
  3. # @name Update to version 2.2
  4. # @author Tobias Reich
  5. # @copyright 2014 by Tobias Reich
  6. ###
  7. if (!$database->query("SELECT `visible` FROM `lychee_albums` LIMIT 1;")) {
  8. $result = $database->query("ALTER TABLE `lychee_albums` ADD `visible` TINYINT(1) NOT NULL DEFAULT 1");
  9. if (!$result) {
  10. Log::error($database, 'update_020200', __LINE__, 'Could not update database (' . $database->error . ')');
  11. return false;
  12. }
  13. }
  14. $result = $database->query("UPDATE lychee_settings SET value = '020200' WHERE `key` = 'version';");
  15. if (!$result) {
  16. Log::error($database, 'update_020200', __LINE__, 'Could not update database (' . $database->error . ')');
  17. return false;
  18. }
  19. ?>