belongsToMany Foreign UUID not working.
makzumi opened this issue · 18 comments
- Laravel Version: 10.10
- PHP Version: 8.1
- Blueprint Version: 2.9
- Platform: Windows
Issue:
The pivot table on a belongsToMany is not respecting UUID from the related models. Should be foreignUuid
draft.yaml:
models:
Brand:
uuid
name: string index
slug: string unique index
logo: string nullable
softDeletes
relationships:
belongsToMany: Product
Product:
uuid
name: string index
slug: unique index
price: double:8,2
softDeletes
relationships:
belongsToMany: Brand
Could you pull from master
and see if it work. A PR was recently merged that may address this...
Thanks Jason, will give it a try and thanks for Blueprint!
sorry, nope, it is still not working, just tried master. :(
Ok. @rcrosbourne is this something your PR might have fixed?
You definitely aren't pulling from master
as that code has changed. So it'd be good to ensure you have set your composer constraint to dev-master
and run composer update
.
Try again and see if it generates the "correct" code. Also, if not, disable use_constraints
and see if it does (without the constraints of course).
I guess I can use it like this, thanks so much @jasonmccreary
The other path should be supported.
@rcrosbourne, seems your PR missed the path for setting foreign UUID/ULID columns with constraints (i.e. use_constraints
enabled). I'd appreciate if you could fix that path.
Yea I will take a look at it.
This PR addresses the issue.
Any news about this?
Nope.
No plan to merge the #661?
It seems ready. It's not a big problem to edit migrations manually, but if it's fixed...
As noted on the PR, it has some changes requested and like 46 commits which it difficult to review/trust. I plan to give more time to Blueprint after the release of Laravel 11. However, until then I don't have the time to wade through this PR unless the author can clean it up a bit.
I understand, sorry I saw the commits, but didn't have time either to read all the comments. Anyway if this issue is easy to fix (I guess it is), would be opening a new PR just for it, be a solution?
I welcome any PRs. It's easier on the maintainer if the changes are concise, have a well explained PR description, and contain passing tests.