update_030003.php 793 B

12345678910111213141516171819202122232425
  1. <?php
  2. ###
  3. # @name Update to version 3.0.3
  4. # @copyright 2015 by Tobias Reich
  5. ###
  6. if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
  7. # Add skipDuplicates to settings
  8. $query = Database::prepare($database, "SELECT `key` FROM `?` WHERE `key` = 'skipDuplicates' LIMIT 1", array(LYCHEE_TABLE_SETTINGS));
  9. $result = $database->query($query);
  10. if ($result->num_rows===0) {
  11. $query = Database::prepare($database, "INSERT INTO `?` (`key`, `value`) VALUES ('skipDuplicates', '0')", array(LYCHEE_TABLE_SETTINGS));
  12. $result = $database->query($query);
  13. if (!$result) {
  14. Log::error($database, 'update_030003', __LINE__, 'Could not update database (' . $database->error . ')');
  15. return false;
  16. }
  17. }
  18. # Set version
  19. if (Database::setVersion($database, '030003')===false) return false;
  20. ?>