mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-3349: Possibility to override order of fields of composite ID produced by Mapping #4140
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 @doctrinebot on GitHub (Oct 13, 2014).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user tiger-seo:
So, the problem is when the one needs to use association key in composite identifier; they are added in the end of the identifier array, which is clearly not always suitable in regards to performance.
For example, following mapping:
will turn into sql as:
and there is no way to change the order of the primary from
PRIMARY KEY (date, country*code, page_id)toPRIMARY KEY (date, page_id, country*code)@doctrinebot commented on GitHub (Oct 13, 2014):
@doctrinebot commented on GitHub (Oct 14, 2014):
Comment created by tiger-seo:
i've done the PR for this, pls see https://github.com/doctrine/doctrine2/pull/1162
@doctrinebot commented on GitHub (Oct 17, 2014):
Comment created by @doctrinebot:
A related Github Pull-Request [GH-1162] was assigned:
https://github.com/doctrine/doctrine2/pull/1162
@doctrinebot commented on GitHub (Jan 16, 2015):
Comment created by @doctrinebot:
A related Github Pull-Request [GH-1162] was closed:
https://github.com/doctrine/doctrine2/pull/1162
@leongersen commented on GitHub (Aug 5, 2019):
This issue can probably be closed. A PR for this issue was closed with the following suggestion:
For reference, such a listener would look like this:
@SenseException commented on GitHub (Aug 14, 2019):
@doctrine/doctrinecore Should this be the default solution or is this issue from 2015 still relevant for a PR?
@Ocramius commented on GitHub (Aug 24, 2019):
I'd say that the solution by @leongersen is the correct one: subtype overrides shouldn't need more ORM-specific changes, but rather metadata creation hooks 👍