Framework: [Proposal] Timestamps nullable by default

Created on 27 Jun 2013  路  2Comments  路  Source: laravel/framework

I ran into a problem with my timestamps which was caused by running MySQL in strict mode. As things are right now, timestamps created with the schema builder have their default value set to 0 (unless of course they are nullable), which is an invalid date.

My suggestion is to let timestamps be nullable by default. I imagine there are people out there who check for $date === '0000-00-00 00:00:00', so such a change would probably break backwards compatibility. It might cause too big of a problem for too small of a problem, but I wanted to let you know.

Most helpful comment

$table->nullableTimestamps... just added it.

All 2 comments

:+1:

This one has caught me up a few times too. NULL timestamps would be nicer than 0000-00-00 00:00:00.

$table->nullableTimestamps... just added it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lzp819739483 picture lzp819739483  路  3Comments

YannPl picture YannPl  路  3Comments

RomainSauvaire picture RomainSauvaire  路  3Comments

shopblocks picture shopblocks  路  3Comments

ghost picture ghost  路  3Comments