[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 Sun Aug 30 02:02:12 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.