瀏覽代碼

Fix migration parameter handling

Signed-off-by: Joas Schilling <coding@schilljs.com>
tags/v26.0.0beta1
Joas Schilling 1 年之前
父節點
當前提交
4d98128e9a
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 8 行新增9 行删除
  1. 8
    9
      core/Migrations/Version25000Date20221007010957.php

+ 8
- 9
core/Migrations/Version25000Date20221007010957.php 查看文件

@@ -51,23 +51,22 @@ class Version25000Date20221007010957 extends SimpleMigrationStep {
*/
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
$cleanUpQuery = $this->connection->getQueryBuilder();

$orExpr = $cleanUpQuery->expr()->orX(
$cleanUpQuery->expr()->eq('configkey', $cleanUpQuery->createNamedParameter('background')),
$cleanUpQuery->expr()->eq('configkey', $cleanUpQuery->createNamedParameter('backgroundVersion')),
);

$cleanUpQuery->delete('preferences')
->where($cleanUpQuery->expr()->eq('appid', $cleanUpQuery->createNamedParameter('theming')))
->andWhere($orExpr);
->andWhere($cleanUpQuery->expr()->orX(
$cleanUpQuery->expr()->eq('configkey', $cleanUpQuery->createNamedParameter('background')),
$cleanUpQuery->expr()->eq('configkey', $cleanUpQuery->createNamedParameter('backgroundVersion')),
));
$cleanUpQuery->executeStatement();

$updateQuery = $this->connection->getQueryBuilder();
$updateQuery->update('preferences')
->set('appid', $updateQuery->createNamedParameter('theming'))
->where($updateQuery->expr()->eq('appid', $updateQuery->createNamedParameter('dashboard')))
->andWhere($orExpr);

->andWhere($updateQuery->expr()->orX(
$updateQuery->expr()->eq('configkey', $updateQuery->createNamedParameter('background')),
$updateQuery->expr()->eq('configkey', $updateQuery->createNamedParameter('backgroundVersion')),
));
$updateQuery->executeStatement();
}
}

Loading…
取消
儲存