nextcloud/lib/public/Migration/Attributes/ModifyColumn.php
Maxence Lange 88cfab4f32 feat(upgrade): migration attributes
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>

d

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>

f

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>

d

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2024-07-29 12:44:52 -01:00

22 lines
702 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\Migration\Attributes;
use Attribute;
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_CLASS)]
class ModifyColumn extends ColumnMigrationAttribute {
public function definition(): string {
$type = is_null($this->getType()) ? '' : ' to ' . $this->getType()->value;
$table = empty($this->getTable()) ? '' : ' from table \'' . $this->getTable() . '\'';
return empty($this->getName()) ?
'Modification of a column' . $table . $type
: 'Modification of column \'' . $this->getName() . '\'' . $table . $type;
}
}