diff --git a/lib/private/Preview/PreviewMigrationService.php b/lib/private/Preview/PreviewMigrationService.php index d3db56fc69cb1..7c7581c631884 100644 --- a/lib/private/Preview/PreviewMigrationService.php +++ b/lib/private/Preview/PreviewMigrationService.php @@ -161,12 +161,16 @@ private static function getInternalFolder(string $name, bool $flatPath): string private function deleteFolder(string $path): void { $current = $path; + $rootFolderId = $this->rootFolder->getMountPoint()->getNumericStorageId(); while (true) { $appDataPath = $this->previewRootPath . $current; $qb = $this->connection->getQueryBuilder(); $qb->delete('filecache') ->where($qb->expr()->eq('path_hash', $qb->createNamedParameter(md5($appDataPath)))) - ->hintShardKey('storage', $this->rootFolder->getMountPoint()->getNumericStorageId()) + ->andWhere($qb->expr()->eq( + 'storage', + $qb->createNamedParameter($rootFolderId), + )) ->executeStatement(); $current = dirname($current);