From f71c7f7af29bdd71276b68f3c9a49b41872cfa10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20=C3=96zg=C3=BCn=20Turan?= Date: Wed, 13 Mar 2024 12:56:28 +0100 Subject: [PATCH] Remove obsolete and unnecessary properties from `Table` attribute (#11351) The properties `indexes` and `uniqueConstraints` were present before and were used for the `AnnotationDriver` but were never implemented for the `AttributeDriver`. Since the `AnnotationDriver` doesn't exist anymore these can be safely removed reducing possible confusion when defining indices and uniqueConstraints in the `Table` attribute which never worked anyway. --- UPGRADE.md | 6 ++++++ src/Mapping/Table.php | 8 +------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 64a040ddeae..e6c6d737626 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -21,6 +21,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 8a06deebc42..41103d3613c 100644 --- a/src/Mapping/Table.php +++ b/src/Mapping/Table.php @@ -9,16 +9,10 @@ #[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 = [], ) { }