From d586e95c19d8f7b9d22532486676df92464e8c3d Mon Sep 17 00:00:00 2001 From: Christian Hartmann Date: Wed, 15 Jan 2025 19:00:36 +0100 Subject: [PATCH] fix: subtraction in access_enum Signed-off-by: Christian Hartmann --- lib/Migration/Version050000Date20241005173955.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Migration/Version050000Date20241005173955.php b/lib/Migration/Version050000Date20241005173955.php index d93ee3ead..ccc58d09a 100644 --- a/lib/Migration/Version050000Date20241005173955.php +++ b/lib/Migration/Version050000Date20241005173955.php @@ -11,6 +11,7 @@ use Closure; use OCP\DB\ISchemaWrapper; +use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; @@ -31,7 +32,10 @@ public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $qbUpdate = $this->db->getQueryBuilder(); $qbUpdate->update('forms_v2_forms') - ->set('access_enum', 'access_enum - 3') + ->set('access_enum', $qbUpdate->func()->subtract( + 'access_enum', + $qbUpdate->createNamedParameter(3, IQueryBuilder::PARAM_INT) + )) ->where($qbUpdate->expr()->gte('access_enum', '3')) ->executeStatement(); }