I have an doctrine entity in a Symfony2 project defined as:

/**
  * @ORM\Entity
  * @ORM\Table(name="`user`")
 */
class User 

The table name is escaped in this definition, but the problem described 
here occurs whether it is escaped or not.

The associated mysql database does have a table named 'user'. 

Somewhere, somehow, doctrine decides that the table associated with the 
entity User is named 'User', not 'user', and goes looking for a table named 
'User' 

This isn't a problem in my Windows dev environment, but on the linux 
production server my app does not work.

When I do something like this on the linux server:

$em = $container->get('doctrine')->getManager();
> $user_repo = $em->getRepository('Acme\Bundle\UserBundle\Entity\User');
> $user = $user_repo->find(1);
>

I get this:

PHP Fatal error:  Uncaught exception 'PDOException' with message 
> 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'acme.User' 
> doesn't exist' in 
> /home/acme/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:641
>

I know it would be better not to use a table named 'user', but I am working 
with an existing mysql database in which that is the name of one of the 
tables, and this database is also used by a legacy php app in which that 
table name cannot be changed (at least not without enormous difficulty).

Can anyone tell me what code causes this and whether it can be fixed, 
adjusted, etc?  

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to