laravel-model-stats
laravel-model-stats copied to clipboard
Syntax error or access violation: 1101 BLOB, TEXT, GEOMETRY or JSON column 'body' can't have a default value
BUG Installation

PHP version

Mysql Version

Hey, I’m usually working with PostgreSQL. I didn’t get a chance to try the package with MySQL. I think removing the default value from the migration and adding a default value in the ‘$attributes’ property of the dashboard Model would fix it. I’ll try to take a look at it this week. If you have some time to try that change, please feel free to 😉
has this been resolved?

I don't use Mysql so if anyone can try to implement the fix I suggested above, I'd appreciate. Otherwise I'll try to take a look tomorrow.
Removing the default value actually works but it isn't the better way to solve the problem, I switched from jsonb to varchar and setted the default value through Datagrip, and it's working in my local environment, I even mocked data using a production dump and it's working perfectly
Then we can remove it only for mysql. Of course, in any cases we need to add the default value on the model attributes. I created this PR #3 to try the fix. I don't have the right setup to test it. Can one of you try @leandrofacim @Eolykab @Oxicode ?