addIndex
で複合ユニークキーに設定したいカラムと['unique' => true]
を指定する。
$table = $this->table('table_name');
$table->addColumn('company_id', 'integer', ['limit' => 11])
->addColumn('employee_id', 'integer', ['limit' => 11])
->addIndex(['company_id', 'employee_id'], ['unique' => true]);
マイグレーション関連はCakeのCookbookよりPhinxのマニュアルを見た方が色々載っているので良い。
(参考) http://docs.phinx.org/en/latest/migrations.html#creating-a-table