Delete theming background preferences

Signed-off-by: Christopher Ng <chrng8@gmail.com>
pull/34461/head
Christopher Ng 4 years ago committed by Vincent Petry (Rebase PR Action)
parent 7599cbb529
commit 7f5ef4dcf7
  1. 14
      core/Migrations/Version25000Date20221007010957.php

@ -52,13 +52,19 @@ class Version25000Date20221007010957 extends SimpleMigrationStep {
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
$qb = $this->connection->getQueryBuilder();
$orExpr = $qb->expr()->orX(
$qb->expr()->eq('configkey', $qb->createNamedParameter('background')),
$qb->expr()->eq('configkey', $qb->createNamedParameter('backgroundVersion')),
);
$qb->delete('preferences')
->where($qb->expr()->eq('appid', $qb->createNamedParameter('theming')))
->andWhere($orExpr);
$qb->update('preferences')
->set('appid', $qb->createNamedParameter('theming'))
->where($qb->expr()->eq('appid', $qb->createNamedParameter('dashboard')))
->andWhere($qb->expr()->orX(
$qb->expr()->eq('configkey', $qb->createNamedParameter('background')),
$qb->expr()->eq('configkey', $qb->createNamedParameter('backgroundVersion'))
));
->andWhere($orExpr);
$qb->executeStatement();
}

Loading…
Cancel
Save