Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doctrine ORM table with schema annotation

Schema and table name in Postgres are case sensitive. How can I specify correct schema in docblock annotations so they are not converted to lowercase?

Neither of these works:

@Table(name="MySchema.MyTable") // gets converted to lowercase
@Table(name="`MySchema`.`MyTable`") // invalid table
@Table(name="`MySchema.MyTable`") // also invalid table

Doctrine ORM is 2.0.4

Theres no word about schema in documentation either, only found that schema param/keyword is no longer supported.

like image 734
Peter Avatar asked May 12 '11 11:05

Peter


1 Answers

As mentioned in this thread, Postgres is case-sensitive and each word must be escaped:

@Table(name="""MySchema"".""MyTable""")
like image 52
Ross Avatar answered Sep 23 '22 03:09

Ross