Attributes in annotations to specify Constraint, Index (etc.) name. #6215

Closed
opened 2026-01-22 15:29:02 +01:00 by admin · 1 comment
Owner

Originally created by @ancpru on GitHub (Apr 3, 2019).

Originally assigned to: @Ocramius on GitHub.

Feature Request

Q A
New Feature yes
RFC yes/no
BC Break no

Summary

Doctrine automatically generates the names of the constraints/indexes for @OneToMany, @ManyToMany, They are sometimes a bit cryptic when working on the DB. It would be
nice to have an attribute like "constraintName" in the definition.

In general I think that it would be nice to have more db-schema hints in order to make automatic schema generation easier and more straight forward.

For example, cascading (update, delete) might not make sense for ORM, but it can be useful to let the DB take care of it.

Originally created by @ancpru on GitHub (Apr 3, 2019). Originally assigned to: @Ocramius on GitHub. ### Feature Request <!-- Fill in the relevant information below to help triage your issue. --> | Q | A |------------ | ------ | New Feature | yes | RFC | yes/no | BC Break | no #### Summary Doctrine automatically generates the names of the constraints/indexes for @OneToMany, @ManyToMany, They are sometimes a bit cryptic when working on the DB. It would be nice to have an attribute like "constraintName" in the definition. In general I think that it would be nice to have more db-schema hints in order to make automatic schema generation easier and more straight forward. For example, cascading (update, delete) might not make sense for ORM, but it can be useful to let the DB take care of it. <!-- Provide a summary of the feature you would like to see implemented. -->
admin added the New FeatureWon't Fix labels 2026-01-22 15:29:02 +01:00
admin closed this issue 2026-01-22 15:29:02 +01:00
Author
Owner

@Ocramius commented on GitHub (Apr 3, 2019):

ON UPDATE cascade operations are something that will not be re-introduced in ORM. See also https://github.com/doctrine/orm/issues/7574#issuecomment-479335970

Please use a migration tool with custom-written migrations for customising constraint names and cascade operations that are not supported by the ORM. Closing as duplicate of #3753

@Ocramius commented on GitHub (Apr 3, 2019): `ON UPDATE` cascade operations are something that will not be re-introduced in ORM. See also https://github.com/doctrine/orm/issues/7574#issuecomment-479335970 Please use a migration tool with custom-written migrations for customising constraint names and cascade operations that are not supported by the ORM. Closing as duplicate of #3753
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6215