【问题标题】:How do you change the Collation of a column using Phinx如何使用 Phinx 更改列的排序规则
【发布时间】:2017-06-05 20:39:11
【问题描述】:

我刚开始学习 Phinx,我需要将列的排序规则更改为 latin1_swedish_ci。我没有找到有关如何执行此操作的文档。我假设它类似于:

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

但是,我看到有人说这个功能还没有实现。 https://github.com/robmorgan/phinx/issues/661

如果有人有办法解决这个问题,那就太好了!

【问题讨论】:

    标签: collation phinx


    【解决方案1】:

    此功能已于0.7.0 实施。

    要将表bar 中现有列foo 的排序规则更改为latin1_swedish_ci,如下所示:

    $this->table('bar')
        ->changeColumn('foo', 'string', array(
            'collation' => 'latin1_swedish_ci',
        ))
        ->update();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-02-13
      • 2015-04-03
      • 2011-08-28
      • 1970-01-01
      • 2010-11-20
      • 2011-11-12
      • 1970-01-01
      • 2015-03-05
      相关资源
      最近更新 更多