原则ORM定制列排序规则

问题描述:

我正在Doctrine文档中设置自定义列排序规则:

I'm trying to set custom column collation as in Doctrine documentation:

  • http://doctrine-dbal.readthedocs.org/en/latest/reference/schema-representation.html and
  • http://doctrine-orm.readthedocs.org/en/latest/reference/annotations-reference.html

使用

@ ORM\Column(name =body,type =string,length = 140,options = {customSchemaOptions= { collat​​e=utf8mb4_unicode_ci}})

但是当我更新架构时,它总是返回到utf8_unicode_ci(手动设置时)例如)。任何想法?

but when I update the schema it always goes back to utf8_unicode_ci (when I set it manually for example). Any ideas?

如果您(或其他人)仍然需要,现在已添加,请参阅 http://doctrine-orm.readthedocs.org/en/latest/ reference / annotations-reference.html#annref-column

This has been added by now if you (or someone else) still need, see http://doctrine-orm.readthedocs.org/en/latest/reference/annotations-reference.html#annref-column

示例:

/**
 * @var string
 *
 * @ORM\Column(type="string", length=64, nullable=false, options={"collation":"utf8_bin"})
 */
private $code;

现在,所有常用数据库驱动程序都支持。

This is supported by all common database drivers now.