-
Notifications
You must be signed in to change notification settings - Fork 10
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
Ulid Data truncated for column 'metable_id' #26
Comments
temporaly, I have change your migration file to $table->ulidMorphs('metable'); |
Will have a look at this, thanks. |
I think what you did (changing the migration file) is the way to go. Or do you have another recommendation? Just checked how this problem is handled in another package: https://spatie.be/docs/laravel-permission/v6/advanced-usage/uuid |
The best would have been to have the choice of morph type during installation but I don't know how to do that. |
see #27 |
I’m thinking about having this configurable. So one would have to publish the config before migration, choose between numeric ids or UUID/ULID and then the migration would take this into account. What do you think? |
idd...that will be beter...in the config file have a option to choice beteween ids (default) or uuid or ulid and when you run the migration, choice the good morph type link to the config. Do you want that I try to do it ? |
Would happily accept a PR for that, yes. But please add test cases for having Otherwise I may will find the time towards the end of the week. |
* feat: add support for `uuid` and `ulid` primary keys resolves #26 * ci: reduce tests run by morph type * fix: add support for uuid and ulid in Laravel 9 * docs: update section about uuid and ulid support * Fix styling [skip-ci] * fix: make sure string was passed * ci: reduce tests run by morph type --------- Co-authored-by: marijoo <marijoo@users.noreply.github.com>
🎉 This issue has been resolved in version 1.2.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Hello,
The primary key of my model is a ulid type and when a try to insert metas I have this error :
" SQLSTATE[01000]: Warning: 1265 Data truncated for column 'metable_id' at row 1 (Connection: mysql, SQL: insert into
meta(
key,
type,
value,
published_at,
metable_id,
metable_type,
updated_at,
created_at) values (color, integer, 87, 2023-12-17 07:12:59, 01hhv9xdt2nbx12zgffb76vpy8, App\Models\Item, 2023-12-17 07:12:59, 2023-12-17 07:12:59))"
Can I change something to use ulid and not id ?
Thanks you
The text was updated successfully, but these errors were encountered: