diff --git a/UPGRADE.md b/UPGRADE.md index af65aeec8d5..a460818f11d 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -25,6 +25,12 @@ Using array access on instances of the following classes is no longer possible: - `Doctrine\ORM\Mapping\JoinColumnMapping` - `Doctrine\ORM\Mapping\JoinTableMapping` +## Remove properties `$indexes` and `$uniqueConstraints` from `Doctrine\ORM\Mapping\Table` + +The properties `$indexes` and `$uniqueConstraints` have been removed since they had no effect at all. +The preferred way of defining indices and unique constraints is by +using the `\Doctrine\ORM\Mapping\UniqueConstraint` and `\Doctrine\ORM\Mapping\Index` attributes. + # Upgrade to 3.2 ## `orm:schema-tool:update` option `--complete` is deprecated diff --git a/src/Mapping/Table.php b/src/Mapping/Table.php index ac1e8edfa35..41103d3613c 100644 --- a/src/Mapping/Table.php +++ b/src/Mapping/Table.php @@ -5,41 +5,15 @@ namespace Doctrine\ORM\Mapping; use Attribute; -use Doctrine\Deprecations\Deprecation; #[Attribute(Attribute::TARGET_CLASS)] final class Table implements MappingAttribute { - /** - * @param array|null $indexes - * @param array|null $uniqueConstraints - * @param array $options - */ + /** @param array $options */ public function __construct( public readonly string|null $name = null, public readonly string|null $schema = null, - public readonly array|null $indexes = null, - public readonly array|null $uniqueConstraints = null, public readonly array $options = [], ) { - if ($this->indexes !== null) { - Deprecation::trigger( - 'doctrine/orm', - 'https://github.com/doctrine/orm/pull/11357', - 'Providing the property $indexes on %s does not have any effect and will be removed in Doctrine ORM 4.0. Please use the %s attribute instead.', - self::class, - Index::class, - ); - } - - if ($this->uniqueConstraints !== null) { - Deprecation::trigger( - 'doctrine/orm', - 'https://github.com/doctrine/orm/pull/11357', - 'Providing the property $uniqueConstraints on %s does not have any effect and will be removed in Doctrine ORM 4.0. Please use the %s attribute instead.', - self::class, - UniqueConstraint::class, - ); - } } }