From 4e753748e560fa78eca6e97776d6ca800be33c3e Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Tue, 28 Jan 2025 22:28:29 +0100 Subject: [PATCH] fix(Db): Allow guest displaynames with a length of up to 255 chars useful in federated setup Signed-off-by: Arthur Schiwon --- .../Version2060Date20200302131958.php | 2 +- .../Version9000Date20250128212050.php | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 lib/Migration/Version9000Date20250128212050.php diff --git a/lib/Migration/Version2060Date20200302131958.php b/lib/Migration/Version2060Date20200302131958.php index 09bd814509..9c1ec387e9 100644 --- a/lib/Migration/Version2060Date20200302131958.php +++ b/lib/Migration/Version2060Date20200302131958.php @@ -44,7 +44,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt ]); $table->addColumn('guest_displayname', 'string', [ 'notnull' => false, - 'length' => 64, + 'length' => 255, ]); $table->addColumn('fileid', 'bigint', [ 'notnull' => true, diff --git a/lib/Migration/Version9000Date20250128212050.php b/lib/Migration/Version9000Date20250128212050.php new file mode 100644 index 0000000000..5b2d75e05b --- /dev/null +++ b/lib/Migration/Version9000Date20250128212050.php @@ -0,0 +1,39 @@ +hasTable('richdocuments_wopi')) { + return null; + } + + $table = $schema->getTable('richdocuments_wopi'); + if (!$table->hasColumn('guest_displayname')) { + return null; + } + + $column = $table->getColumn('guest_displayname'); + if ($column->getLength() === 255) { + return null; + } + + $column->setLength(255); + return $schema; + } +}