Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Delete theming background preferences
Signed-off-by: Christopher Ng <[email protected]>
  • Loading branch information
Pytal authored and PVince81 committed Oct 13, 2022
commit 7f5ef4dcf751bcd5f17dddf140d349d645b24cba
14 changes: 10 additions & 4 deletions core/Migrations/Version25000Date20221007010957.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,19 @@ public function __construct(IDBConnection $connection) {
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();
}
Expand Down