Z3d0X / filament-logger

Extensible activity logger for filament that works out-of-the-box.
MIT License
279 stars 40 forks source link

Error: Data truncated for column 'subject_id' at row 1 #35

Closed Odilbukh closed 1 year ago

Odilbukh commented 1 year ago

I have installed the package filament-logget in my fresh laravel project. Then I have installed buildix/timex package. When I create, delete or update event on timex there is error from filament-logger. You can see it in screenshot.

I have created issue about it in for buildix/timex (https://github.com/buildix/timex/issues/29) but I reived answer like:

" Hello. Thank you. I'm not sure that it refers to timex actually.

The error occurred because filament-logger (laravel logger) is using morphs and timex is using uuid - so it has to either timex database changes upon migration not to use uuid, or logger database adjustments to

$table->nullableUuidMorphs('taggable'); "

So can you help me fix the issue?

Thanks!

image

Z3d0X commented 1 year ago

Seems like the default migration of spatie's logger doesn't support uuids. Please follow the steps mentioned in discussions from spatie/laravel-activitylog:

https://github.com/spatie/laravel-activitylog/issues/666

https://github.com/spatie/laravel-activitylog/discussions/771

Odilbukh commented 1 year ago

@Z3d0X Thank you!

FYI: I changed field "subject_id" fron integer to string. So issue was solved