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? |
Ocramius
left a comment
There was a problem hiding this comment.
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 |
|
Ok, I've merged upstream. |
|
I rebased, I fixed the build in #7731, this means the tests might now pass. |
ostrolucky
left a comment
There was a problem hiding this comment.
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 |
ostrolucky
left a comment
There was a problem hiding this comment.
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_replaceinstead of astring_replacethat only replaces the _id at the end of a column name.