-
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
only replace '_id' at end of columnName #7684
Conversation
Could someone point me in the right direction for creating a test-case? I would need a (mock) driver that supports foreign-keys |
@rharink check https://github.com/doctrine/doctrine2/blob/master/tests/Doctrine/Tests/ORM/Functional/Ticket for examples of test cases. I'd suggest a scenario that runs on SQLite only and:
|
@Ocramius Thanks for the reply, The SqlLite driver doesn't support foreign keys. The returns
|
True, would need to design this with MySQL or equivalent |
Should I use a |
Sorry should read more before asking ;) I found documentation on how to run tests on mysql. |
@Ocramius Checks have passed, should / can I do anything else? |
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.
Overall looking good: needs adjustments in test naming and placing (need to check if we can turn this into a full unit tests, eventually - not sure if that is feasible)
@Ocramius can I do something else? maybe add a unit test in the databaseDriverTest.php? Just let me know |
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.
LGTM 👍
@rharink can you rebase on top of upstream/2.6
so that we can see if the CI failures are related to this patch at all?
Besides that, just needs a merge from our end.
Ok, I've merged upstream. |
I rebased, I fixed the build in #7731, this means the tests might now pass. |
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.
Test case is unfortunately not correct. It passes for previous behaviour too.
Wow good catch! Well at least the build is green now 😅 @rharink please look into this 🙏 |
Good one! Ill look in to it. |
@ostrolucky nice catch indeed, thanks! @rharink since we're aiming at releasing the last patch of the Thanks for putting effort into this and I hope we can solve it together in the next patch 👍 |
I've improved the unit-test. it didn't pass for previous behaviour as the key |
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.
Test is correct now. @lcobucci I would say we can merge this now to 2.6.5 what do you say?
Please kindly squash your commits together. If you don't, we'll try to remember to do it for you but it's best if you save us this trouble. How to do that?
|
@rharink @ostrolucky awesome, thanks for being that quick. Please follow @greg0ire's instructions and let's ship this! |
@lcobucci @ostrolucky done, lets go! |
@rharink 🚢 |
I've encountered a problem with foreign-key column-names that have a '_id' (e.g. _identity) in their name.
These columns don't get renamed properly (
partner_identity_card
->partnerentityCard
).The fix could be a
preg_replace
instead of astring_replace
that only replaces the _id at the end of a column name.