I am using Doctrine with Symfony2. My config.yml file looks something like this:-
doctrine:
dbal:
driver: %data
if you are looking for a way to have migrations be created correctly you should setup the connection
you can set the default_table_options connection option to achieve this: in symfony this is done through:
doctrine:
dbal:
default_table_options:
charset: utf8
collate: utf8_general_ci
for those looking to do it in plain doctrine this translates to doctrine connection option defaultDatabaseOptions, and is passed to the entity manager together with your database credentials etc:
[
...
'driver' => ...
'user' => ...
...
'defaultDatabaseOptions' => [
'charset' => 'utf8',
'collate' => 'utf8_general_ci'
]
]