phinx
phinx copied to clipboard
Add a Phinx\Db\Table::addTimestamps() method
This method should automatically create two datetime columns: created_at and updated_at.
Call the following code:
$table->addColumn('created', 'datetime')
$table->addColumn('updated', 'datetime', array('null' => true, 'default' => null))
Maybe use the CURRENT_TIMESTAMP support I added here: https://github.com/robmorgan/phinx/pull/68
I find having the date fields automatically updating saves excess code :)
Names of columns should be configurable in phinx.yml, default values: created_at and updated_at