update_030003.php 806 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * Update to version 3.0.3
  4. */
  5. use Lychee\Modules\Database;
  6. if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
  7. // Add skipDuplicates to settings
  8. $query = Database::prepare($connection, "SELECT `key` FROM `?` WHERE `key` = 'skipDuplicates' LIMIT 1", array(LYCHEE_TABLE_SETTINGS));
  9. $result = Database::execute($connection, $query, 'update_030003', __LINE__);
  10. if ($result===false) return false;
  11. if ($result->num_rows===0) {
  12. $query = Database::prepare($connection, "INSERT INTO `?` (`key`, `value`) VALUES ('skipDuplicates', '0')", array(LYCHEE_TABLE_SETTINGS));
  13. $result = Database::execute($connection, $query, 'update_030003', __LINE__);
  14. if ($result===false) return false;
  15. }
  16. // Set version
  17. if (Database::setVersion($connection, '030003')===false) return false;
  18. ?>