summaryrefslogtreecommitdiffstats
path: root/apps/files_versions/lib
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2024-02-08 18:47:07 +0100
committerLouis Chemineau <louis@chmn.me>2024-02-08 18:47:07 +0100
commit5ae0f5b32fdd84ec9e0e0a59cda1cae069fa4903 (patch)
tree5cb1b860a45cea26d76d758ea493075e98b0d621 /apps/files_versions/lib
parent303e2febc717065581a3e3bdc92e1672bb8253dc (diff)
downloadnextcloud-server-5ae0f5b32fdd84ec9e0e0a59cda1cae069fa4903.tar.gz
nextcloud-server-5ae0f5b32fdd84ec9e0e0a59cda1cae069fa4903.zip
Revert "Reapply "Cleanup versions entity in during versions:clean command""
This reverts commit ba3fdb0cdcfbb84f0080a2146a4ba2f01569915d.
Diffstat (limited to 'apps/files_versions/lib')
-rw-r--r--apps/files_versions/lib/Command/CleanUp.php3
-rw-r--r--apps/files_versions/lib/Db/VersionsMapper.php17
2 files changed, 0 insertions, 20 deletions
diff --git a/apps/files_versions/lib/Command/CleanUp.php b/apps/files_versions/lib/Command/CleanUp.php
index be66ce8ffb3..519b3689a58 100644
--- a/apps/files_versions/lib/Command/CleanUp.php
+++ b/apps/files_versions/lib/Command/CleanUp.php
@@ -24,7 +24,6 @@
*/
namespace OCA\Files_Versions\Command;
-use OCA\Files_Versions\Db\VersionsMapper;
use OCP\Files\IRootFolder;
use OCP\IUserBackend;
use OCP\IUserManager;
@@ -38,7 +37,6 @@ class CleanUp extends Command {
public function __construct(
protected IRootFolder $rootFolder,
protected IUserManager $userManager,
- protected VersionsMapper $versionMapper,
) {
parent::__construct();
}
@@ -122,7 +120,6 @@ class CleanUp extends Command {
\OC_Util::setupFS($user);
$fullPath = '/' . $user . '/files_versions' . ($path ? '/' . $path : '');
- $this->versionMapper->deleteAllVersionsForUser($user);
if ($this->rootFolder->nodeExists($fullPath)) {
$this->rootFolder->get($fullPath)->delete();
}
diff --git a/apps/files_versions/lib/Db/VersionsMapper.php b/apps/files_versions/lib/Db/VersionsMapper.php
index 9b5d7a52c13..bc6e8b264de 100644
--- a/apps/files_versions/lib/Db/VersionsMapper.php
+++ b/apps/files_versions/lib/Db/VersionsMapper.php
@@ -27,7 +27,6 @@ declare(strict_types=1);
namespace OCA\Files_Versions\Db;
use OCP\AppFramework\Db\QBMapper;
-use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
/**
@@ -84,20 +83,4 @@ class VersionsMapper extends QBMapper {
->where($qb->expr()->eq('file_id', $qb->createNamedParameter($fileId)))
->executeStatement();
}
-
- public function deleteAllVersionsForUser(string $userId): int {
- $deleteQuery = $this->db->getQueryBuilder();
- $filesVersionSelect = $this->db->getQueryBuilder();
- $filesVersionSelect->select('fileid')
- ->from('filecache', 'f')
- ->join('f', 'mounts', 'm', $filesVersionSelect->expr()->eq('f.storage', 'm.storage_id'))
- ->where($filesVersionSelect->expr()->like('f.path', $deleteQuery->createNamedParameter('files/%', IQueryBuilder::PARAM_STR)))
- ->andWhere($filesVersionSelect->expr()->eq('m.user_id', $deleteQuery->createNamedParameter($userId, IQueryBuilder::PARAM_STR)))
- ->andWhere($filesVersionSelect->expr()->eq('m.mount_point', $deleteQuery->createNamedParameter("/$userId/", IQueryBuilder::PARAM_STR)));
-
- $deleteQuery->delete($this->getTableName())
- ->where($deleteQuery->expr()->in('file_id', $deleteQuery->createFunction($filesVersionSelect->getSQL()), IQueryBuilder::PARAM_INT_ARRAY));
-
- return $deleteQuery->executeStatement();
- }
}