Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-352

Running doctrine:schema:update throws an exception the first time, succeeds the second time.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Schema Managers
    • Security Level: All
    • Labels:
      None

      Description

      Shell output from my symfony project:
      $ app/console doctrine:schema:update --force
      Updating database schema...

      [Doctrine\DBAL\DBALException]
      An exception occurred while executing 'ALTER TABLE Tn ADD CONSTRAINT FK_3504C6F07D3656A4 FOREIGN KEY (account) REFERENCES Account (id)':

      SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'account' doesn't exist in table

      [PDOException]
      SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'account' doesn't exist in table

      doctrine:schema:update [--complete] [--dump-sql] [--force] [--em[="..."]]

      $ app/console doctrine:schema:update --force
      Updating database schema...
      Database schema updated successfully! "7" queries were executed
      $

        Activity

        Mark A. Hershberger created issue -

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Mark A. Hershberger
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: