Doctrine2: How to set all tables to collate with UTF8

前端 未结 14 1030
夕颜
夕颜 2020-12-08 02:55

I am using Doctrine with Symfony2. My config.yml file looks something like this:-

Doctrine Configuration

doctrine:
    dbal:
        driver: %data         


        
14条回答
  •  隐瞒了意图╮
    2020-12-08 03:30

    Use code below to set collation, engine and charset (annotation example):

    /**
    * @ORM\Table(
    *     name="temporary", 
    *     options={"collate":"utf8_general_ci", "charset":"utf8", "engine":"MyISAM"}
    * )  
    * @ORM\Entity
    */    
    

    Source: http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/annotations-reference.html#annref-column

提交回复
热议问题