Skip to content

Commit

Permalink
Remove obsolete and unnecessary properties from Table attribute (do…
Browse files Browse the repository at this point in the history
…ctrine#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.
  • Loading branch information
DaDeather committed Mar 15, 2024
1 parent ea7cc64 commit f71c7f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 6 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions src/Mapping/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,10 @@
#[Attribute(Attribute::TARGET_CLASS)]
final class Table implements MappingAttribute
{
/**
* @param array<Index>|null $indexes
* @param array<UniqueConstraint>|null $uniqueConstraints
* @param array<string,mixed> $options
*/
/** @param array<string,mixed> $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 = [],
) {
}
Expand Down

0 comments on commit f71c7f7

Please sign in to comment.