Skip to content

Commit

Permalink
fix: subtraction in access_enum
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Hartmann <[email protected]>
  • Loading branch information
Chartman123 committed Jan 15, 2025
1 parent 798f2e6 commit d586e95
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Migration/Version050000Date20241005173955.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
))

Check warning on line 38 in lib/Migration/Version050000Date20241005173955.php

View check run for this annotation

Codecov / codecov/patch

lib/Migration/Version050000Date20241005173955.php#L35-L38

Added lines #L35 - L38 were not covered by tests
->where($qbUpdate->expr()->gte('access_enum', '3'))
->executeStatement();
}
Expand Down

0 comments on commit d586e95

Please sign in to comment.