From d47189831c7e28f365e6d1ae1528c374af7061e6 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Wed, 3 Sep 2025 19:56:27 -0100 Subject: [PATCH] feat(migration-attributes): set as Consumable Signed-off-by: Maxence Lange --- lib/public/Migration/Attributes/AddColumn.php | 4 ++-- lib/public/Migration/Attributes/AddIndex.php | 4 ++-- lib/public/Migration/Attributes/ColumnMigrationAttribute.php | 5 +++-- lib/public/Migration/Attributes/ColumnType.php | 4 +++- lib/public/Migration/Attributes/CreateTable.php | 4 ++-- lib/public/Migration/Attributes/DataCleansing.php | 4 ++-- lib/public/Migration/Attributes/DataMigrationAttribute.php | 5 +++-- lib/public/Migration/Attributes/DropColumn.php | 4 ++-- lib/public/Migration/Attributes/DropIndex.php | 4 ++-- lib/public/Migration/Attributes/DropTable.php | 4 ++-- .../Migration/Attributes/GenericMigrationAttribute.php | 5 +++-- lib/public/Migration/Attributes/IndexMigrationAttribute.php | 5 +++-- lib/public/Migration/Attributes/IndexType.php | 5 +++-- lib/public/Migration/Attributes/MigrationAttribute.php | 5 ++--- lib/public/Migration/Attributes/ModifyColumn.php | 4 ++-- lib/public/Migration/Attributes/TableMigrationAttribute.php | 5 +++-- 16 files changed, 39 insertions(+), 32 deletions(-) diff --git a/lib/public/Migration/Attributes/AddColumn.php b/lib/public/Migration/Attributes/AddColumn.php index d84a0c1f60c..e371ec81d19 100644 --- a/lib/public/Migration/Attributes/AddColumn.php +++ b/lib/public/Migration/Attributes/AddColumn.php @@ -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 diff --git a/lib/public/Migration/Attributes/AddIndex.php b/lib/public/Migration/Attributes/AddIndex.php index ee22fe7f128..86b5a89c389 100644 --- a/lib/public/Migration/Attributes/AddIndex.php +++ b/lib/public/Migration/Attributes/AddIndex.php @@ -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 diff --git a/lib/public/Migration/Attributes/ColumnMigrationAttribute.php b/lib/public/Migration/Attributes/ColumnMigrationAttribute.php index b32d3501a0d..d3f4aa05ade 100644 --- a/lib/public/Migration/Attributes/ColumnMigrationAttribute.php +++ b/lib/public/Migration/Attributes/ColumnMigrationAttribute.php @@ -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 diff --git a/lib/public/Migration/Attributes/ColumnType.php b/lib/public/Migration/Attributes/ColumnType.php index ab6044e3ae2..54c0365bc9e 100644 --- a/lib/public/Migration/Attributes/ColumnType.php +++ b/lib/public/Migration/Attributes/ColumnType.php @@ -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'; diff --git a/lib/public/Migration/Attributes/CreateTable.php b/lib/public/Migration/Attributes/CreateTable.php index df0418fa4bc..c774b0aff56 100644 --- a/lib/public/Migration/Attributes/CreateTable.php +++ b/lib/public/Migration/Attributes/CreateTable.php @@ -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 diff --git a/lib/public/Migration/Attributes/DataCleansing.php b/lib/public/Migration/Attributes/DataCleansing.php index 565ed58c3e1..6215c8b0268 100644 --- a/lib/public/Migration/Attributes/DataCleansing.php +++ b/lib/public/Migration/Attributes/DataCleansing.php @@ -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 diff --git a/lib/public/Migration/Attributes/DataMigrationAttribute.php b/lib/public/Migration/Attributes/DataMigrationAttribute.php index 6fea8382e33..08d12a9f37b 100644 --- a/lib/public/Migration/Attributes/DataMigrationAttribute.php +++ b/lib/public/Migration/Attributes/DataMigrationAttribute.php @@ -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 { } diff --git a/lib/public/Migration/Attributes/DropColumn.php b/lib/public/Migration/Attributes/DropColumn.php index a1cd5790cc7..4d0568a0a4e 100644 --- a/lib/public/Migration/Attributes/DropColumn.php +++ b/lib/public/Migration/Attributes/DropColumn.php @@ -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 diff --git a/lib/public/Migration/Attributes/DropIndex.php b/lib/public/Migration/Attributes/DropIndex.php index 2702cbed9a7..39bdd64ced7 100644 --- a/lib/public/Migration/Attributes/DropIndex.php +++ b/lib/public/Migration/Attributes/DropIndex.php @@ -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 diff --git a/lib/public/Migration/Attributes/DropTable.php b/lib/public/Migration/Attributes/DropTable.php index e90e4804a3c..ad18d07c8ef 100644 --- a/lib/public/Migration/Attributes/DropTable.php +++ b/lib/public/Migration/Attributes/DropTable.php @@ -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 diff --git a/lib/public/Migration/Attributes/GenericMigrationAttribute.php b/lib/public/Migration/Attributes/GenericMigrationAttribute.php index e55591010f0..870182b0398 100644 --- a/lib/public/Migration/Attributes/GenericMigrationAttribute.php +++ b/lib/public/Migration/Attributes/GenericMigrationAttribute.php @@ -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 diff --git a/lib/public/Migration/Attributes/IndexMigrationAttribute.php b/lib/public/Migration/Attributes/IndexMigrationAttribute.php index 0dd7194b448..31b9e2da277 100644 --- a/lib/public/Migration/Attributes/IndexMigrationAttribute.php +++ b/lib/public/Migration/Attributes/IndexMigrationAttribute.php @@ -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 diff --git a/lib/public/Migration/Attributes/IndexType.php b/lib/public/Migration/Attributes/IndexType.php index 45c88d81041..dc3fcb9c656 100644 --- a/lib/public/Migration/Attributes/IndexType.php +++ b/lib/public/Migration/Attributes/IndexType.php @@ -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'; diff --git a/lib/public/Migration/Attributes/MigrationAttribute.php b/lib/public/Migration/Attributes/MigrationAttribute.php index d5b2d52cafb..4df46e7a2fe 100644 --- a/lib/public/Migration/Attributes/MigrationAttribute.php +++ b/lib/public/Migration/Attributes/MigrationAttribute.php @@ -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 diff --git a/lib/public/Migration/Attributes/ModifyColumn.php b/lib/public/Migration/Attributes/ModifyColumn.php index 6fc44ebb824..f34c29db74a 100644 --- a/lib/public/Migration/Attributes/ModifyColumn.php +++ b/lib/public/Migration/Attributes/ModifyColumn.php @@ -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 diff --git a/lib/public/Migration/Attributes/TableMigrationAttribute.php b/lib/public/Migration/Attributes/TableMigrationAttribute.php index 25d0e1c2d7c..aede981c10f 100644 --- a/lib/public/Migration/Attributes/TableMigrationAttribute.php +++ b/lib/public/Migration/Attributes/TableMigrationAttribute.php @@ -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