feat(migration-attributes): set as Consumable

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
This commit is contained in:
Maxence Lange 2025-09-03 19:56:27 -01:00 committed by backportbot[bot]
parent 7c38a4d117
commit 80656e5ebc
16 changed files with 39 additions and 32 deletions

View file

@ -9,13 +9,13 @@ declare(strict_types=1);
namespace OCP\Migration\Attributes;
use Attribute;
use OCP\AppFramework\Attribute\Consumable;
/**
* attribute on new column creation
*
* @since 30.0.0
*/
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_CLASS)]
#[Consumable(since: '30.0.0')]
class AddColumn extends ColumnMigrationAttribute {
/**
* @return string

View file

@ -9,13 +9,13 @@ declare(strict_types=1);
namespace OCP\Migration\Attributes;
use Attribute;
use OCP\AppFramework\Attribute\Consumable;
/**
* attribute on index creation
*
* @since 30.0.0
*/
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_CLASS)]
#[Consumable(since: '30.0.0')]
class AddIndex extends IndexMigrationAttribute {
/**
* @return string

View file

@ -8,11 +8,12 @@ declare(strict_types=1);
*/
namespace OCP\Migration\Attributes;
use OCP\AppFramework\Attribute\Consumable;
/**
* generic class related to migration attribute about column changes
*
* @since 30.0.0
*/
#[Consumable(since: '30.0.0')]
class ColumnMigrationAttribute extends MigrationAttribute {
/**
* @param string $table name of the database table

View file

@ -8,12 +8,14 @@ declare(strict_types=1);
*/
namespace OCP\Migration\Attributes;
use OCP\AppFramework\Attribute\Consumable;
/**
* enum ColumnType based on OCP\DB\Types
*
* @see \OCP\DB\Types
* @since 30.0.0
*/
#[Consumable(since: '30.0.0')]
enum ColumnType : string {
/** @since 30.0.0 */
case BIGINT = 'bigint';

View file

@ -9,13 +9,13 @@ declare(strict_types=1);
namespace OCP\Migration\Attributes;
use Attribute;
use OCP\AppFramework\Attribute\Consumable;
/**
* attribute on table creation
*
* @since 30.0.0
*/
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_CLASS)]
#[Consumable(since: '30.0.0')]
class CreateTable extends TableMigrationAttribute {
/**
* @return string

View file

@ -9,13 +9,13 @@ declare(strict_types=1);
namespace OCP\Migration\Attributes;
use Attribute;
use OCP\AppFramework\Attribute\Consumable;
/**
* attribute on new column creation
*
* @since 32.0.0
*/
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_CLASS)]
#[Consumable(since: '32.0.0')]
class DataCleansing extends DataMigrationAttribute {
/**
* @return string

View file

@ -8,10 +8,11 @@ declare(strict_types=1);
*/
namespace OCP\Migration\Attributes;
use OCP\AppFramework\Attribute\Consumable;
/**
* generic class related to migration attribute about data migration
*
* @since 32.0.0
*/
#[Consumable(since: '32.0.0')]
class DataMigrationAttribute extends MigrationAttribute {
}

View file

@ -9,13 +9,13 @@ declare(strict_types=1);
namespace OCP\Migration\Attributes;
use Attribute;
use OCP\AppFramework\Attribute\Consumable;
/**
* attribute on column drop
*
* @since 30.0.0
*/
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_CLASS)]
#[Consumable(since: '30.0.0')]
class DropColumn extends ColumnMigrationAttribute {
/**
* @return string

View file

@ -9,13 +9,13 @@ declare(strict_types=1);
namespace OCP\Migration\Attributes;
use Attribute;
use OCP\AppFramework\Attribute\Consumable;
/**
* attribute on index drop
*
* @since 30.0.0
*/
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_CLASS)]
#[Consumable(since: '30.0.0')]
class DropIndex extends IndexMigrationAttribute {
/**
* @return string

View file

@ -9,13 +9,13 @@ declare(strict_types=1);
namespace OCP\Migration\Attributes;
use Attribute;
use OCP\AppFramework\Attribute\Consumable;
/**
* attribute on table drop
*
* @since 30.0.0
*/
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_CLASS)]
#[Consumable(since: '30.0.0')]
class DropTable extends TableMigrationAttribute {
/**
* @return string

View file

@ -8,12 +8,13 @@ declare(strict_types=1);
*/
namespace OCP\Migration\Attributes;
use OCP\AppFramework\Attribute\Consumable;
/**
* generic entry, used to replace migration attribute not yet known in current version
* but used in a future release
*
* @since 30.0.0
*/
#[Consumable(since: '30.0.0')]
class GenericMigrationAttribute extends MigrationAttribute {
/**
* @param array $details

View file

@ -8,11 +8,12 @@ declare(strict_types=1);
*/
namespace OCP\Migration\Attributes;
use OCP\AppFramework\Attribute\Consumable;
/**
* generic class related to migration attribute about index changes
*
* @since 30.0.0
*/
#[Consumable(since: '30.0.0')]
class IndexMigrationAttribute extends MigrationAttribute {
/**
* @param string $table name of the database table

View file

@ -8,11 +8,12 @@ declare(strict_types=1);
*/
namespace OCP\Migration\Attributes;
use OCP\AppFramework\Attribute\Consumable;
/**
* type of index
*
* @since 30.0.0
*/
#[Consumable(since: '30.0.0')]
enum IndexType : string {
/** @since 30.0.0 */
case PRIMARY = 'primary';

View file

@ -9,10 +9,9 @@ declare(strict_types=1);
namespace OCP\Migration\Attributes;
use JsonSerializable;
use OCP\AppFramework\Attribute\Consumable;
/**
* @since 30.0.0
*/
#[Consumable(since: '30.0.0')]
class MigrationAttribute implements JsonSerializable {
/**
* @param string $table name of the database table

View file

@ -9,13 +9,13 @@ declare(strict_types=1);
namespace OCP\Migration\Attributes;
use Attribute;
use OCP\AppFramework\Attribute\Consumable;
/**
* attribute on column modification
*
* @since 30.0.0
*/
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_CLASS)]
#[Consumable(since: '30.0.0')]
class ModifyColumn extends ColumnMigrationAttribute {
/**
* @return string

View file

@ -8,11 +8,12 @@ declare(strict_types=1);
*/
namespace OCP\Migration\Attributes;
use OCP\AppFramework\Attribute\Consumable;
/**
* generic class related to migration attribute about table changes
*
* @since 30.0.0
*/
#[Consumable(since: '30.0.0')]
class TableMigrationAttribute extends MigrationAttribute {
/**
* @param string $table name of the database table