Skip to content

Commit a528ddc

Browse files
committed
update migration
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
1 parent 324a309 commit a528ddc

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/Migration/Version03001001Date20241111105515.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
use Closure;
1212
use OCA\Google\AppInfo\Application;
13+
use OCP\AppFramework\Services\IAppConfig;
1314
use OCP\DB\QueryBuilder\IQueryBuilder;
14-
use OCP\IConfig;
1515
use OCP\IDBConnection;
1616
use OCP\Migration\IOutput;
1717
use OCP\Migration\SimpleMigrationStep;
@@ -20,7 +20,7 @@
2020
class Version03001001Date20241111105515 extends SimpleMigrationStep {
2121

2222
public function __construct(
23-
private IConfig $config,
23+
private IAppConfig $appConfig,
2424
private IDBConnection $connection,
2525
private ICrypto $crypto,
2626
) {
@@ -34,11 +34,11 @@ public function __construct(
3434
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
3535
// migrate api credentials in app config
3636
foreach (['client_id', 'client_secret'] as $key) {
37-
$value = $this->config->getAppValue(Application::APP_ID, $key);
37+
$value = $this->appConfig->getAppValueString($key, '');
3838
if ($value === '') {
3939
continue;
4040
}
41-
$this->config->setAppValue(Application::APP_ID, $key, $this->crypto->encrypt($value));
41+
$this->appConfig->setAppValueString($key, $this->crypto->encrypt($value));
4242
}
4343

4444
// user tokens

0 commit comments

Comments
 (0)