update_020200.php 644 B

12345678910111213141516171819202122
  1. <?php
  2. ###
  3. # @name Update to version 2.2
  4. # @author Tobias Reich
  5. # @copyright 2014 by Tobias Reich
  6. ###
  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. ?>