-
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
[WIP] Foreign association index names #956
Conversation
Hello, thank you for creating this pull request. I have automatically opened an issue http://www.doctrine-project.org/jira/browse/DDC-2990 We use Jira to track the state of pull requests and the versions they got |
$foreignTableName, | ||
$localColumns, | ||
$foreignColumns, | ||
$fkOptions | ||
$fkOptions, | ||
$fkName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is worng because it is the name of the foreign key constraint and not the name of the index to be created under the hood. What you need to do is call $theJoinTable->addIndex()
before adding the foreign key and do not pass the index names as foreign key name when adding the foreign key.
This is a good start but missing a lot of things. We need to implement that addition in all mapping drivers and for all association types. Also we need tests for this. And as discussed before @beberlei does not like this solution. We should decide on a solution first before we put unnecesarry work into this (I have an open branch on this, too). Nevertheless thank you for contributing on this :) |
Please prefix the PR name with |
Sure, was just putting something out for conversation. Thanks for the feedback. Were/how do conversations around new feature development typically happen? In the JIRA or do you collaborate on IRC, etc |
@jsuggs either push to the branch or on irc://freenode.net#doctrine-dev during CET times |
Hello, guys! Is there still work in progress? Very useful but missed ability... |
@dbykadorov if you want to contribute, then provide tests for this PR |
Closing as per @deeky666's review. |
This is actually fixed as per doctrine/dbal#769, which comes with release 2.5.1 of the DBAL. |
Still not fixed since it's not possible to set a custom name for a foreign key. There are situations where you don't want to change the FK name, for example when dropping a FK and recreating it is not feasible because the table is huge, or when the db structure is shared between different applications. For those coming here trying to find a way to do that, see this workaround: https://stackoverflow.com/a/77736787/3393663 |
See http://www.doctrine-project.org/jira/browse/DDC-2989