Sfoglia il codice sorgente

fix querybuilder instance recuse

...and execute delete query

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
tags/v26.0.0beta1
Arthur Schiwon 1 anno fa
parent
commit
b4f6329a83
1 ha cambiato i file con 12 aggiunte e 10 eliminazioni
  1. 12
    10
      core/Migrations/Version25000Date20221007010957.php

+ 12
- 10
core/Migrations/Version25000Date20221007010957.php Vedi File

@@ -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();
}
}

Loading…
Annulla
Salva