mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Attributes in annotations to specify Constraint, Index (etc.) name. #6215
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ancpru on GitHub (Apr 3, 2019).
Originally assigned to: @Ocramius on GitHub.
Feature Request
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.
@Ocramius commented on GitHub (Apr 3, 2019):
ON UPDATEcascade operations are something that will not be re-introduced in ORM. See also https://github.com/doctrine/orm/issues/7574#issuecomment-479335970Please 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