-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeDriver
ignores index and unique constraint definitions in Table
attribute
#11351
Comments
…ine#11351) This allows defining indices and unique constraints through the `Table` attribute which already provides these properties but which aren't respected by the `AttributeDriver`.
We should remove those properties |
…ine#11351) This allows defining indices and unique constraints through the `Table` attribute which already provides these properties but which aren't respected by the `AttributeDriver`.
…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.
As we both agree on it being unnecessary to have 2 different approaches to the same, I've created a PR to remove these properties from the |
…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.
…octrine#11351) The properties `indexes` and `uniqueConstraints` were used by the `AnnotationDriver` but were never implemented for the `AttributeDriver`. Since the `AnnotationDriver` doesn't exist anymore these can become deprecated and will then be removed afterwards.
…octrine#11351) The properties `indexes` and `uniqueConstraints` were used by the `AnnotationDriver` but were never implemented for the `AttributeDriver`. Since the `AnnotationDriver` doesn't exist anymore these can become deprecated and will then be removed afterwards.
…octrine#11351) The properties `indexes` and `uniqueConstraints` were used by the `AnnotationDriver` but were never implemented for the `AttributeDriver`. Since the `AnnotationDriver` doesn't exist anymore these can become deprecated and will then be removed afterwards.
…octrine#11351) The properties `indexes` and `uniqueConstraints` were used by the `AnnotationDriver` but were never implemented for the `AttributeDriver`. Since the `AnnotationDriver` doesn't exist anymore these can become deprecated and will then be removed afterwards.
…solete-indexes-and-unique-constraint-properties-of-table-attribute Deprecate obsolete and unnecessary properties from Table attribute (#11351)
…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.
…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.
…s-and-unique-constraint-properties-from-table-attribute Remove obsolete and unnecessary properties from `Table` attribute (#11351)
Bug Report
Summary
Since the implementation of the
AttributeDriver
there's a bug that the properties of theTable
attribute aren't counted in for the indices and unique constraints.Current behavior
Currently setting the indices and unique constraints through the
Table
attribute results in them being ignored which therefore disallows the usage of nested attributes.This is being handled here:
orm/src/Mapping/Driver/AttributeDriver.php
Lines 165 to 173 in a809a71
Before with annotations, this was possible and the code for the correct interpretation of these was implemented in the
AnnotationDriver
:orm/src/Mapping/Driver/AnnotationDriver.php
Lines 137 to 224 in a809a71
How to reproduce
Creating an entity with the following attributes:
This wouldn't be handled by the
AttributeDriver
.But doing it this way works:
Expected behavior
The nested attribute variant should also work as expected if indices and / or unique constrains are defined within the
Table
attribute.OR if this is unwanted behavior it should be removed to reduce confusions in terms of defining the table definitions.
The text was updated successfully, but these errors were encountered: