robmorgan/phinx — pull request #274 by jonathan-galpin (2014-07-23 20:20:10+00:00)
Title: Constraint Naming Fix

This allows naming of a constraint. Currently, you will only receive the mysql auto named constraint.
Currently only this syntax works: ->addForeignKey( 'client_id', 'clients', 'client_id' )

This fix will allow this syntax to be used: ->addForeignKey( 'client_id', 'clients', 'client_id', array( 'constraint' => 'my_constraint_name_xxx', 'delete' => 'RESTRICT', 'update' => 'RESTRICT' ) )
The "constraint" option was not being handled properly, resulting in invalid SQL syntax

Signed-off-by: Jonathan Galpin