update_020200.php 620 B

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