9

I just started learning Phinx, and I am needing to change the collation of a column to latin1_swedish_ci. I'm not finding documentation on how to do this. I'm assuming it would be similar to:

->addColumn('text_two', 'string', ['collation' => 'latin1_swedish_ci'])

However, I have seen some talk that this feature wasn't implemented yet. https://github.com/robmorgan/phinx/issues/661

If anyone has any ways around this, that would be great!

4

1 回答 1

8

此功能已于0.7.0.

foo要将表中现有列的排序规则更改barlatin1_swedish_ci,它看起来像这样:

$this->table('bar')
    ->changeColumn('foo', 'string', array(
        'collation' => 'latin1_swedish_ci',
    ))
    ->update();
于 2017-07-12T19:21:51.950 回答