robmorgan/phinx — pull request #68 by valorin (2013-03-29 00:20:28+00:00)
Title: Added support for 'ON UPDATE' column function, and updated 'timestamp' column type.

To facilitate specifying a column as: `timestamp default current_timestamp on update current_timestamp`, I've made a couple of changes:

1. The `timestamp` column type now specifies the MySQL `timestamp` column type. This was previously the `datetime` column type, however, this column type does not support the `ON UPDATE` or `CURRENT_TIMESTAMP` options. This is the one questionable change that I have made, as it may possibly cause issues with other projects relying on the `datetime` column... thoughts?

2. When the `default` option is specified for a column with the value `CURRENT_TIMESTAMP`, it is no longer quoted into the SQL. This is needed to ensure the SQL accepts it as a function, rather than a value.

3. The `update` column option was added to provide a way to specify the MySQL function to use `ON UPDATE` for the column.

Example usage:

```php
$table->addColumn('updated', 'timestamp',
Array('default' => "CURRENT_TIMESTAMP", 'update' => "CURRENT_TIMESTAMP"));
```

I'm happy to make changes if any of this doesn't fit with your design/plans for Phinx :)