update_030001.php 945 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. ###
  3. # @name Update to version 3.0.1
  4. # @copyright 2015 by Tobias Reich
  5. ###
  6. if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
  7. # Change length of photo title
  8. $query = Database::prepare($database, "ALTER TABLE `?` CHANGE `title` `title` VARCHAR( 100 ) NOT NULL DEFAULT ''", array(LYCHEE_TABLE_PHOTOS));
  9. $result = $database->query($query);
  10. if (!$result) {
  11. Log::error($database, 'update_030001', __LINE__, 'Could not update database (' . $database->error . ')');
  12. return false;
  13. }
  14. # Change length of album title
  15. $query = Database::prepare($database, "ALTER TABLE `?` CHANGE `title` `title` VARCHAR( 100 ) NOT NULL DEFAULT ''", array(LYCHEE_TABLE_ALBUMS));
  16. $result = $database->query($query);
  17. if (!$result) {
  18. Log::error($database, 'update_030001', __LINE__, 'Could not update database (' . $database->error . ')');
  19. return false;
  20. }
  21. # Set version
  22. if (Database::setVersion($database, '030001')===false) return false;
  23. ?>