update_020200.php 691 B

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