diff --git a/lib/Db/SignRequestMapper.php b/lib/Db/SignRequestMapper.php
index a4e05952fa..e97cb45708 100644
--- a/lib/Db/SignRequestMapper.php
+++ b/lib/Db/SignRequestMapper.php
@@ -24,6 +24,7 @@
namespace OCA\Libresign\Db;
+use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use OCA\Libresign\Helper\Pagination;
use OCA\Libresign\Service\IdentifyMethod\IIdentifyMethod;
use OCA\Libresign\Service\IdentifyMethodService;
@@ -464,6 +465,9 @@ private function getFilesAssociatedFilesWithMeQueryBuilder(string $userId, ?stri
'f.status',
'f.created_at',
);
+ if (!$qb->getConnection()->getDatabasePlatform() instanceof PostgreSQLPlatform) {
+ $qb->addGroupBy('f.metadata');
+ }
$or = [
$qb->expr()->eq('f.user_id', $qb->createNamedParameter($userId)),
diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml
index 0e69cf47a7..0c7fde2668 100644
--- a/tests/psalm-baseline.xml
+++ b/tests/psalm-baseline.xml
@@ -55,6 +55,14 @@
callable(QueryBuilder): void
+
+
+ PostgreSQLPlatform
+
+
+ $qb->getConnection()->getDatabasePlatform()
+
+
LoadSidebar