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

kerbylav picture kerbylav  路  3Comments

Fuzzyma picture Fuzzyma  路  3Comments

Anahkiasen picture Anahkiasen  路  3Comments

iivanov2 picture iivanov2  路  3Comments

SachinAgarwal1337 picture SachinAgarwal1337  路  3Comments