tags:

views:

42

answers:

2

Doctrine turns my column names into all lower case to improve compatibility. How do I prevent this from happening?

users:
  actAs: [Timestampable]
  columns:
    userId:
      type: integer
      length: 4
      primary: true
      autoincrement: true

or

$this->hasColumn('userId', 'integer', 4, array(
         'type' => 'integer',
         'length' => 4,
         'primary' => true,
         'autoincrement' => true,
         ));

then becomes

userid

This is a problem because I have lots of existing code and data that uses the camelCase convention. Is there some sort of easy boolean I can change to make it keep my columns exactly as written?

+1  A: 

The Yaml conversion is where the issue lies. To fix this you need to alias the column name in the YAML schema file IE: name: user_id as userId

Brad F Jacobs
A: 

Mysql isn't case sensitive so it doesn't actually matter that my old code uses a camel case userId and the database column is userid

Not everybody is using MySQL ;) PostgreSQL for example is case sensitive
Timo