Doctrine use same collation on all tables (even plugins)

It really annoys me when I set my schema collate to utf8_general_ci but plugin tables are created as latin1_swedish_ci.

Solution?

Create the following method on your ProjectConfiguration.class.php

1
2
3
4
5
6
7
8
9
class ProjectConfiguration extends sfProjectConfiguration
{
    public function configureDoctrine(Doctrine_Manager $manager)
    {
        $manager->setCollate('utf8_general_ci');
        $manager->setCharset('utf8');

    }
}

Props to: http://www.prettyscripts.com/framework/symfony/symfony-and-doctrine-default-table-collation-a-better-solution

One thought on “Doctrine use same collation on all tables (even plugins)”

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>