Skip to content

Conversation

@lotarbo
Copy link
Contributor

@lotarbo lotarbo commented Apr 25, 2023

foreignIdFor creates column uses UUID type in Postgres, but related model uses ULID. So we have an error with that like this
invalid input syntax for type uuid: "01gytdbw84sf4d0d2tsserk73t"

I think it should check what trait mode uses and pick the correct method for it

@GrahamCampbell GrahamCampbell changed the title Use foreignUlid if model uses HasUlids trait when call foreignIdFor [10.x] Use foreignUlid if model uses HasUlids trait when call foreignIdFor Apr 25, 2023
@taylorotwell taylorotwell merged commit e2a65b3 into laravel:10.x Apr 25, 2023
milwad-dev pushed a commit to milwad-dev/framework that referenced this pull request May 12, 2023
…IdFor (laravel#46876) * fix: use foreignUlid if model uses HasUlids * test: add assert for MySql * Update Blueprint.php --------- Co-authored-by: Taylor Otwell <taylor@laravel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants