Skip to content

Commit 1986502

Browse files
committed
fix(Db): Allow guest displaynames with a length of up to 255 chars
useful in federated setup Signed-off-by: Arthur Schiwon <[email protected]>
1 parent e254226 commit 1986502

File tree

4 files changed

+42
-1
lines changed

4 files changed

+42
-1
lines changed

composer/composer/autoload_classmap.php

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
'OCA\\Richdocuments\\Migration\\Version30709Date20201111104147' => $baseDir . '/../lib/Migration/Version30709Date20201111104147.php',
6262
'OCA\\Richdocuments\\Migration\\Version30717Date20210310164901' => $baseDir . '/../lib/Migration/Version30717Date20210310164901.php',
6363
'OCA\\Richdocuments\\Migration\\Version50200Date20211220212457' => $baseDir . '/../lib/Migration/Version50200Date20211220212457.php',
64+
'OCA\\Richdocuments\\Migration\\Version9000Date20250128212050' => $baseDir . '/../lib/Migration/Version9000Date20250128212050.php',
6465
'OCA\\Richdocuments\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php',
6566
'OCA\\Richdocuments\\PermissionManager' => $baseDir . '/../lib/PermissionManager.php',
6667
'OCA\\Richdocuments\\Preview\\EMF' => $baseDir . '/../lib/Preview/EMF.php',

composer/composer/autoload_static.php

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ class ComposerStaticInitRichdocuments
9494
'OCA\\Richdocuments\\Migration\\Version30709Date20201111104147' => __DIR__ . '/..' . '/../lib/Migration/Version30709Date20201111104147.php',
9595
'OCA\\Richdocuments\\Migration\\Version30717Date20210310164901' => __DIR__ . '/..' . '/../lib/Migration/Version30717Date20210310164901.php',
9696
'OCA\\Richdocuments\\Migration\\Version50200Date20211220212457' => __DIR__ . '/..' . '/../lib/Migration/Version50200Date20211220212457.php',
97+
'OCA\\Richdocuments\\Migration\\Version9000Date20250128212050' => __DIR__ . '/..' . '/../lib/Migration/Version9000Date20250128212050.php',
9798
'OCA\\Richdocuments\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php',
9899
'OCA\\Richdocuments\\PermissionManager' => __DIR__ . '/..' . '/../lib/PermissionManager.php',
99100
'OCA\\Richdocuments\\Preview\\EMF' => __DIR__ . '/..' . '/../lib/Preview/EMF.php',

lib/Migration/Version2060Date20200302131958.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
4444
]);
4545
$table->addColumn('guest_displayname', 'string', [
4646
'notnull' => false,
47-
'length' => 64,
47+
'length' => 255,
4848
]);
4949
$table->addColumn('fileid', 'bigint', [
5050
'notnull' => true,
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\Richdocuments\Migration;
11+
12+
use Closure;
13+
use OCP\DB\ISchemaWrapper;
14+
use OCP\Migration\IOutput;
15+
use OCP\Migration\SimpleMigrationStep;
16+
17+
class Version9000Date20250128212050 extends SimpleMigrationStep {
18+
19+
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
20+
/** @var ISchemaWrapper $schema */
21+
$schema = $schemaClosure();
22+
if (!$schema->hasTable('richdocuments_wopi')) {
23+
return null;
24+
}
25+
26+
$table = $schema->getTable('richdocuments_wopi');
27+
if (!$table->hasColumn('guest_displayname')) {
28+
return null;
29+
}
30+
31+
$column = $table->getColumn('guest_displayname');
32+
if ($column->getLength() === 255) {
33+
return null;
34+
}
35+
36+
$column->setLength(255);
37+
return $schema;
38+
}
39+
}

0 commit comments

Comments
 (0)