mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
And remove all the duplication in the subclasses Signed-off-by: Carl Schwan <carlschwan@kde.org>
38 lines
1 KiB
PHP
38 lines
1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
namespace OC\Core\Migrations;
|
|
|
|
use Closure;
|
|
use OCP\DB\ISchemaWrapper;
|
|
use OCP\Migration\Attributes\ModifyColumn;
|
|
use OCP\Migration\IOutput;
|
|
use OCP\Migration\SimpleMigrationStep;
|
|
use Override;
|
|
|
|
#[ModifyColumn(table: 'taskprocessing_tasks', name: 'error_message', description: 'Increase column length to 4000 bytes to support longer error messages')]
|
|
class Version30000Date20240906095113 extends SimpleMigrationStep {
|
|
|
|
#[Override]
|
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
|
|
/** @var ISchemaWrapper $schema */
|
|
$schema = $schemaClosure();
|
|
|
|
if ($schema->hasTable('taskprocessing_tasks')) {
|
|
$table = $schema->getTable('taskprocessing_tasks');
|
|
$column = $table->getColumn('error_message');
|
|
|
|
if ($column->getLength() < 4000) {
|
|
$column->setLength(4000);
|
|
}
|
|
}
|
|
|
|
return $schema;
|
|
}
|
|
}
|