mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
feat(migration-attributes): set as Consumable
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
This commit is contained in:
parent
7c38a4d117
commit
80656e5ebc
16 changed files with 39 additions and 32 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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…
Reference in a new issue