Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-530

sqlite: foreignKey - definition wrong when tables has databasename as prefix

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      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[...]
      

        Activity

        Andy Rosslau created issue -
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.4 [ 10320 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Andy Rosslau
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: