[DBAL-530] sqlite: foreignKey - definition wrong when tables has databasename as prefix Created: 24/May/13  Updated: 26/May/13  Resolved: 26/May/13

Status: Resolved
Project: Doctrine DBAL
Component/s: None
Affects Version/s: None
Fix Version/s: 2.4
Security Level: All

Type: Bug Priority: Major
Reporter: Andy Rosslau Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


Because of the fact that SQLite doesn't support multiple databases in one file, Doctrine handles definitions like that:

 * @ORM\Entity()
 * @ORM\Table(name="database.table")

in this way:

CREATE TABLE database__table[...]

But when another Tabele references a table defined like the one above, the foreignkey definition is generated wrong:

[...]FOREIGN KEY (table_id) REFERENCES database.table (id) NOT DEFER[...]

SQLSTATE[HY000]: General error: 1 near ".": syntax error

I guess this would be the right query:

[...]FOREIGN KEY (table_id) REFERENCES database__table (id) NOT DEFER[...]

Generated at Thu Jul 30 10:24:38 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.