Skip to content

Commit 4da6e68

Browse files
committed
fix: Add migration changing non-lazy config entries to lazy
Signed-off-by: Marcel Klehr <[email protected]>
1 parent cd67990 commit 4da6e68

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
/*
4+
* Copyright (c) 2020-2025 The Recognize contributors.
5+
* This file is licensed under the Affero General Public License version 3 or later. See the COPYING file.
6+
*/
7+
declare(strict_types=1);
8+
namespace OCA\Recognize\Migration;
9+
10+
use Closure;
11+
use Doctrine\DBAL\Schema\SchemaException;
12+
use OCA\Recognize\Service\SettingsService;
13+
use OCP\AppFramework\Services\IAppConfig;
14+
use OCP\DB\ISchemaWrapper;
15+
use OCP\DB\Types;
16+
use OCP\Migration\IOutput;
17+
use OCP\Migration\SimpleMigrationStep;
18+
19+
final class Version011000002Date20260129094821 extends SimpleMigrationStep {
20+
21+
public function __construct(
22+
private IAppConfig $appConfig,
23+
) {
24+
}
25+
26+
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
27+
foreach (SettingsService::LAZY_SETTINGS as $settingsKey) {
28+
if ($this->appConfig->hasAppKey($settingsKey, lazy: false)) {
29+
$value = $this->appConfig->getAppValueString($settingsKey);
30+
$this->appConfig->deleteAppValue($settingsKey);
31+
$this->appConfig->setAppValueString($settingsKey, $value, lazy: true);
32+
}
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)