DavertMik / doAuthPlugin

Symfony new authentication / user managemant system
MIT License
19 stars 6 forks source link

can not create table user in postgresql #3

Open sergiovier opened 14 years ago

sergiovier commented 14 years ago

In PostgreSQL database, the word "user" is a reserved one. See http://www.postgresql.org/docs/8.4/interactive/sql-keywords-appendix.html.

It's possible rename to something like doauth_user, so all tables can have a suffix?

DavertMik commented 14 years ago

Yep, sure. Need to think on that

DavertMik commented 14 years ago

Yeah, just what I thought :)

sergiovier commented 14 years ago

With tableName i can change the related name of the table.

miamibc commented 14 years ago

You can turn on identifier quoting using the Doctrine_Core::ATTR_QUOTE_IDENTIFIER attribute so that the reserved word is escaped with quotes.

In Symfony you can try add one line to config/databases.yml:

all:
  doctrine:
    class: sfDoctrineDatabase
    param:
      dsn:      your dsn string here
      username: username
      password: password
      attributes:
        quote_identifier: true
DavertMik commented 14 years ago

Oh, thanks. I really thought Doctrine should do that bu default :) But if it doesn't that's really the best fix for it.

miamibc commented 14 years ago

http://trac.doctrine-project.org/ticket/1209

Bugs like this, is another side of this solution. Dunno, i've never used quote_identifier: true, prefer to rename tables ;) Good luck!

DavertMik commented 14 years ago

Ok, I will update a prefix in next version.