Doctrine 2.1 and tables utf-8 coding
Could someone tell me how to force Doctrine to create database tables with UTF-8 coding and utf8_polish_ci? My Doctrine config file has this db configuration parameters:
$conn = array( 'driver' => 'pdo_mysql', 'dbname' => 'test', 'user' => 'root', 'password' => '*****', 'charset' => 'utf8', 'driverOptions' => array(1002=>'SET NAMES utf8'));
Nevertheless, it's still creating table with default coding: latin1 and latin1_swedish_ci.
You set it in your database, doctrine just uses the databases default values. See this question from the Doctrine 2.1 FAQ:
4.1.1. How do I set the charset and collation for MySQL tables?
You can’t set these values inside the annotations, yml or xml mapping files. To make a database work with the default charset and collation you should configure MySQL to use it as default charset, or create the database with charset and collation details. This way they get inherited to all newly created database tables and columns.