Pawel
Pawel

Reputation: 1692

Symfony 2 run on server table name error

Im trying to run symfony 2 app on server and i have an error:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'Slider' 
doesn't exist

But table exists in database. Thing is that the table name is 'slider' not 'Slider'. I dont want to change names of all tables. Any solution ?

Upvotes: 0

Views: 2864

Answers (2)

skoop
skoop

Reputation: 198

You probably have developed the application on a case insensitive OS like Windows or OSX, and now deploy to a linux server, am I right? The only way to prevent this from happening is to define the tablename in your entity class, with the Table annotation:

@ORM\Table(name="Slider")

Upvotes: 1

Stefano Sala
Stefano Sala

Reputation: 907

You have to rename all your table to match Entity names, or you can change the definition in your entity:

/**
 * @ORM\Entity
 * @ORM\Table(name="foo")
 */
class Foo
{
}

Upvotes: 3

Related Questions