Skip to content

Commit 91dda01

Browse files
authored
Merge pull request #11759 from nextcloud/fix/oauth-refresh-token-text-column
fix: migrate mail_accounts.oauth_refresh_token to Types::TEXT
2 parents 67f33f6 + 0341d64 commit 91dda01

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The rating depends on the installed text processing backend. See [the rating ove
3434
3535
Learn more about the Nextcloud Ethical AI Rating [in our blog](https://nextcloud.com/blog/nextcloud-ethical-ai-rating/).
3636
]]></description>
37-
<version>5.6.0-alpha.2</version>
37+
<version>5.6.0-alpha.3</version>
3838
<licence>agpl</licence>
3939
<author homepage="https://github.com/ChristophWurst">Christoph Wurst</author>
4040
<author homepage="https://github.com/GretaD">GretaD</author>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
7+
* SPDX-License-Identifier: AGPL-3.0-or-later
8+
*/
9+
10+
namespace OCA\Mail\Migration;
11+
12+
use Closure;
13+
use Doctrine\DBAL\Types\Type;
14+
use OCP\DB\ISchemaWrapper;
15+
use OCP\DB\Types;
16+
use OCP\Migration\IOutput;
17+
use OCP\Migration\SimpleMigrationStep;
18+
use Override;
19+
20+
class Version5005Date20250927125152 extends SimpleMigrationStep {
21+
22+
/**
23+
* @param Closure(): ISchemaWrapper $schemaClosure
24+
*/
25+
#[Override]
26+
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
27+
$schema = $schemaClosure();
28+
29+
$textColumnType = Type::getType(Types::TEXT);
30+
31+
$mailAccountTable = $schema->getTable('mail_accounts');
32+
$oauthTokenColumn = $mailAccountTable->getColumn('oauth_refresh_token');
33+
if ($oauthTokenColumn->getType() !== $textColumnType) {
34+
$oauthTokenColumn->setType($textColumnType);
35+
}
36+
37+
return $schema;
38+
}
39+
}

0 commit comments

Comments
 (0)