diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2022-10-13 10:29:37 +0200 |
---|---|---|
committer | Vincent Petry (Rebase PR Action) <PVince81@users.noreply.github.com> | 2022-10-13 08:31:33 +0000 |
commit | b4f6329a8390650f21119893261b69b965ae795e (patch) | |
tree | 8f0ad87c1cdf0beb51b29b528e7e16a28d0ef2aa /core/Migrations | |
parent | 7f5ef4dcf751bcd5f17dddf140d349d645b24cba (diff) | |
download | nextcloud-server-b4f6329a8390650f21119893261b69b965ae795e.tar.gz nextcloud-server-b4f6329a8390650f21119893261b69b965ae795e.zip |
fix querybuilder instance recuse
...and execute delete query
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'core/Migrations')
-rw-r--r-- | core/Migrations/Version25000Date20221007010957.php | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/core/Migrations/Version25000Date20221007010957.php b/core/Migrations/Version25000Date20221007010957.php index 5e4a9854382..18d769ab735 100644 --- a/core/Migrations/Version25000Date20221007010957.php +++ b/core/Migrations/Version25000Date20221007010957.php @@ -50,22 +50,24 @@ class Version25000Date20221007010957 extends SimpleMigrationStep { * @param array $options */ public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void { - $qb = $this->connection->getQueryBuilder(); + $cleanUpQuery = $this->connection->getQueryBuilder(); - $orExpr = $qb->expr()->orX( - $qb->expr()->eq('configkey', $qb->createNamedParameter('background')), - $qb->expr()->eq('configkey', $qb->createNamedParameter('backgroundVersion')), + $orExpr = $cleanUpQuery->expr()->orX( + $cleanUpQuery->expr()->eq('configkey', $cleanUpQuery->createNamedParameter('background')), + $cleanUpQuery->expr()->eq('configkey', $cleanUpQuery->createNamedParameter('backgroundVersion')), ); - $qb->delete('preferences') - ->where($qb->expr()->eq('appid', $qb->createNamedParameter('theming'))) + $cleanUpQuery->delete('preferences') + ->where($cleanUpQuery->expr()->eq('appid', $cleanUpQuery->createNamedParameter('theming'))) ->andWhere($orExpr); + $cleanUpQuery->executeStatement(); - $qb->update('preferences') - ->set('appid', $qb->createNamedParameter('theming')) - ->where($qb->expr()->eq('appid', $qb->createNamedParameter('dashboard'))) + $updateQuery = $this->connection->getQueryBuilder(); + $updateQuery->update('preferences') + ->set('appid', $updateQuery->createNamedParameter('theming')) + ->where($updateQuery->expr()->eq('appid', $updateQuery->createNamedParameter('dashboard'))) ->andWhere($orExpr); - $qb->executeStatement(); + $updateQuery->executeStatement(); } } |