Browse Source

feat(migration-attributes): set as Consumable

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/54842/head
Maxence Lange 2 months ago
parent
commit
d47189831c
  1. 4
      lib/public/Migration/Attributes/AddColumn.php
  2. 4
      lib/public/Migration/Attributes/AddIndex.php
  3. 5
      lib/public/Migration/Attributes/ColumnMigrationAttribute.php
  4. 4
      lib/public/Migration/Attributes/ColumnType.php
  5. 4
      lib/public/Migration/Attributes/CreateTable.php
  6. 4
      lib/public/Migration/Attributes/DataCleansing.php
  7. 5
      lib/public/Migration/Attributes/DataMigrationAttribute.php
  8. 4
      lib/public/Migration/Attributes/DropColumn.php
  9. 4
      lib/public/Migration/Attributes/DropIndex.php
  10. 4
      lib/public/Migration/Attributes/DropTable.php
  11. 5
      lib/public/Migration/Attributes/GenericMigrationAttribute.php
  12. 5
      lib/public/Migration/Attributes/IndexMigrationAttribute.php
  13. 5
      lib/public/Migration/Attributes/IndexType.php
  14. 5
      lib/public/Migration/Attributes/MigrationAttribute.php
  15. 4
      lib/public/Migration/Attributes/ModifyColumn.php
  16. 5
      lib/public/Migration/Attributes/TableMigrationAttribute.php

4
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

4
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

5
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

4
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';

4
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

4
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

5
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 {
}

4
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

4
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

4
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

5
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

5
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

5
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';

5
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

4
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

5
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

Loading…
Cancel
Save