Hi,
Based on the little experience I have with Phinx, it seems impossible to specify the name of the foreign key I want when creating a new foreign key. Based on the code in robmorgan/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php, either you have a foreign key with a constraint name OR a foreign key with an automatically generated name.
See https://gist.github.com/tomzx/5663921/revisions for a "potential" quick fix.
See #119
Hi, Is this issue still up for grabs ? I would love to do the necessary to see it merged.
+1
+1
+1
Hello, what's the plan with this feature?
It looks like you can set a foreign key name using the constraint option.
$table = $this->table('your_table');
$table->addForeignKey('foreign_id', 'reference_table', array('id'), array('constraint'=>'your_foreign_key_name'));
$table->save();
This is valid as of
$ vendor/bin/phinx --version
Phinx by Rob Morgan - https://phinx.org. version 0.6.5
Constraint names are supported through the constraint option.