num_rows===0) { $query = Database::prepare($connection, "INSERT INTO `?` (`key`, `value`) VALUES ('sortingAlbums', 'ORDER BY id DESC')", array(LYCHEE_TABLE_SETTINGS)); $result = Database::execute($connection, $query, 'update_030001', __LINE__); if ($result===false) return false; } // Rename sorting to sortingPhotos $query = Database::prepare($connection, "UPDATE ? SET `key` = 'sortingPhotos' WHERE `key` = 'sorting' LIMIT 1", array(LYCHEE_TABLE_SETTINGS)); $result = Database::execute($connection, $query, 'update_030001', __LINE__); if ($result===false) return false; // Add identifier to settings $query = Database::prepare($connection, "SELECT `key` FROM `?` WHERE `key` = 'identifier' LIMIT 1", array(LYCHEE_TABLE_SETTINGS)); $result = Database::execute($connection, $query, 'update_030001', __LINE__); if ($result===false) return false; if ($result->num_rows===0) { $identifier = md5(microtime(true)); $query = Database::prepare($connection, "INSERT INTO `?` (`key`, `value`) VALUES ('identifier', '?')", array(LYCHEE_TABLE_SETTINGS, $identifier)); $result = Database::execute($connection, $query, 'update_030001', __LINE__); if ($result===false) return false; } // Set version if (Database::setVersion($connection, '030001')===false) return false; ?>