robmorgan/phinx — pull request #253 by cyrusboadway (2014-05-18 21:35:51+00:00)
Title: Feature/dry default pk

Both within the code which added the primary key column, and across the PDO adapters for that task, there was a lot of code redundancy. This centralises to a common implementation. As well, there are some other cleanup type items:

- Creates `PDOAdapter::handleDefaultPrimaryKey(Table &$table);` which applies to the given table a default id column as per it's options configuration.
- Draws the default primary key column name into a class constant on `AdapterInterface` (seems like the kind of thing that belongs in the scope of all adapters).
- Draws the default configurations for each PDO adapter into static properties of the class, rather than hard-coded in the method implementation. Sets up for further drying of the table creation methods down the road. _(Imagine having the adapters provide templates for the queries, while the execution happens at a higher level!)_
- Rewrites some string concatenation into an array-push and implode pattern, because it's prettier.