2024-07-17 07:49:11 -04:00
|
|
|
<?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;
|
|
|
|
|
|
2024-07-26 13:35:51 -04:00
|
|
|
/**
|
2024-07-29 07:14:29 -04:00
|
|
|
* attribute on column drop
|
|
|
|
|
*
|
2024-07-26 13:35:51 -04:00
|
|
|
* @since 30.0.0
|
|
|
|
|
*/
|
2024-07-17 07:49:11 -04:00
|
|
|
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_CLASS)]
|
|
|
|
|
class DropColumn extends ColumnMigrationAttribute {
|
2024-07-26 13:35:51 -04:00
|
|
|
/**
|
|
|
|
|
* @return string
|
|
|
|
|
* @since 30.0.0
|
|
|
|
|
*/
|
2024-07-17 07:49:11 -04:00
|
|
|
public function definition(): string {
|
|
|
|
|
return empty($this->getName()) ?
|
2024-07-29 07:14:29 -04:00
|
|
|
'Deletion of a column from table \'' . $this->getTable() . '\''
|
|
|
|
|
: 'Deletion of column \'' . $this->getName() . '\' from table \'' . $this->getTable() . '\'';
|
2024-07-17 07:49:11 -04:00
|
|
|
}
|
|
|
|
|
}
|