update_020601.php 895 B

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