Why are timestamps "allow null" when using MySQL?

Viewed 149

I'm using t.timestamps in migrations. The behavior should produce the following:

'created_at' datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
'updated_at' datetime NOT NULL DEFAULT CURRENT_TIMESTAMP

But instead what rails generates ends up being this in the MySQL db:

'created_at' datetime DEFAULT NULL
'updated_at' datetime DEFAULT NULL

Even though these fields will get auto-populated by rails, the actual database schema should be accurate as well.

Any ideas?

1 Answers
Related