nextcloud/apps/files_sharing/lib/Migration/Version32000Date20251017081948.php
Joas Schilling 75a1a75d4c
fix(federation): Increase the size of owner to allow oCIS cloud ids
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-10-20 15:38:37 +02:00

38 lines
1 KiB
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Files_Sharing\Migration;
use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\Attributes\ColumnType;
use OCP\Migration\Attributes\ModifyColumn;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use Override;
#[ModifyColumn(table: 'share_external', name: 'owner', type: ColumnType::STRING, description: 'Change length to 255 characters')]
class Version32000Date20251017081948 extends SimpleMigrationStep {
/**
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
*/
#[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
$table = $schema->getTable('share_external');
$column = $table->getColumn('owner');
if ($column->getLength() < 255) {
$column->setLength(255);
return $schema;
}
return null;
}
}