update_020601.php 653 B

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