SQL err: Incorrect integer value when using UUID #1606
Replies: 4 comments
-
I'm having the same issue and by changing the migration to a string (varchar) I get "/tmp/****" file does not exist or is not readable." error. Is there a way to fix? |
Beta Was this translation helpful? Give feedback.
-
I got the same issue with |
Beta Was this translation helpful? Give feedback.
-
I found this https://laracasts.com/discuss/channels/laravel/incorrect-integer-value-for-column-notifiable-id |
Beta Was this translation helpful? Give feedback.
-
Replace |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I could not associate images with a model that has
uuid
as the primary key using$community->addMediaFromRequest('media')->toMediaCollection('avatars');
And getting the error:
SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'f71279cd-6f33-4edc-a7fe-7f70cb9d039a' for column 'model_id' at row 1
After some digging I found the migration uses:
$table->morphs('model');
I updated this to:
Everything seems to work fine now, but I'm not sure this is the best way to do it. Is there anything I should be aware of going forward doing it this way?
Beta Was this translation helpful? Give feedback.
All reactions