Support the ongoing development of Laravel.io →
Database Testing
Last updated 2 years ago.
0
Solution

I guess this might be the answer. http://stackoverflow.com/questions/14461851/how-to-have-an-aut...

Basically SQLite doesn't have a datetime data type, but it does accept anything as field type. When you seed, you are doing a plain insert to the database ( It didn't trigger Eloquent model which will fill the timestamp for you ). If you do not specify the datetime field, which in this case, default in NULL, you will get an error since there is not an automatic default value for a "datetime" type in SQLite.

Maybe try put it defaults to 0000-00-00 00:00:00 for that field and see if it works? :D

Last updated 2 years ago.
0

Thanks, awsp! This seems to be the answer indeed!

After switching from

$table->timestamps();

to

$table->nullableTimestamps();

in the migration file the error doesn't occur anymore. So now I have to change that in every single migration-file...

I really hope future versions of Laravel will handle this automatically!

Anyway: Thank you very much!

Last updated 2 years ago.
0

Thanks sauladam, you saved me ! ;)

0

Sign in to participate in this thread!

Eventy

Your banner here too?

sauladam sauladam Joined 11 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.