Skip to content

Commit 1954de0

Browse files
committed
Delete theming background preferences
Signed-off-by: Christopher Ng <[email protected]>
1 parent b1a0753 commit 1954de0

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

core/Migrations/Version25000Date20221007010957.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,19 @@ public function __construct(IDBConnection $connection) {
5252
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
5353
$qb = $this->connection->getQueryBuilder();
5454

55+
$orExpr = $qb->expr()->orX(
56+
$qb->expr()->eq('configkey', $qb->createNamedParameter('background')),
57+
$qb->expr()->eq('configkey', $qb->createNamedParameter('backgroundVersion')),
58+
);
59+
60+
$qb->delete('preferences')
61+
->where($qb->expr()->eq('appid', $qb->createNamedParameter('theming')))
62+
->andWhere($orExpr);
63+
5564
$qb->update('preferences')
5665
->set('appid', $qb->createNamedParameter('theming'))
5766
->where($qb->expr()->eq('appid', $qb->createNamedParameter('dashboard')))
58-
->andWhere($qb->expr()->orX(
59-
$qb->expr()->eq('configkey', $qb->createNamedParameter('background')),
60-
$qb->expr()->eq('configkey', $qb->createNamedParameter('backgroundVersion'))
61-
));
67+
->andWhere($orExpr);
6268

6369
$qb->executeStatement();
6470
}

0 commit comments

Comments
 (0)