-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Db): Allow guest displaynames with a length of up to 255 chars
useful in federated setup Signed-off-by: Arthur Schiwon <[email protected]>
- Loading branch information
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
namespace OCA\Richdocuments\Migration; | ||
|
||
use Closure; | ||
use OCP\DB\ISchemaWrapper; | ||
use OCP\Migration\IOutput; | ||
use OCP\Migration\SimpleMigrationStep; | ||
|
||
class Version9000Date20250128212050 extends SimpleMigrationStep { | ||
|
||
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { | ||
/** @var ISchemaWrapper $schema */ | ||
$schema = $schemaClosure(); | ||
if (!$schema->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; | ||
} | ||
} |