Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-510

Schema tool does not recognize existing columns

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3, 2.4.1
    • Fix Version/s: 2.3.4
    • Component/s: None
    • Security Level: All
    • Labels:
      None
    • Environment:
      Ubuntu 8.04 with PHP 5.3.2 and PostgreSQL 8.4/9.1 (errors on both versions)

      Description

      I'm using doctrine with symfony. The first schema update is working, the table exists with all defined columns.
      When i now run the schema update a second time (without code changes), doctrine tries to create the columns - but they already exists:

      $ php app/console doctrine:schema:update --dump-sql
      CREATE SEQUENCE users_id_seq INCREMENT BY 1 MINVALUE 1 START 1;
      CREATE TABLE users (id INT NOT NULL, email VARCHAR(255) NOT NULL, password VARCHAR(255) DEFAULT NULL, salt VARCHAR(255) DEFAULT NULL, realname VARCHAR(255) NOT NULL, roles TEXT NOT NULL, PRIMARY KEY(id))
      $ php app/console doctrine:schema:update --force
      Updating database schema...
      Database schema updated successfully! "2" queries were executed
      $ php app/console doctrine:schema:update --dump-sql
      ALTER TABLE users ADD id INT NOT NULL;
      ALTER TABLE users ADD email VARCHAR(255) NOT NULL;
      ALTER TABLE users ADD password VARCHAR(255) DEFAULT NULL;
      ALTER TABLE users ADD salt VARCHAR(255) DEFAULT NULL;
      ALTER TABLE users ADD realname VARCHAR(255) NOT NULL;
      ALTER TABLE users ADD roles TEXT NOT NULL;
      ALTER TABLE users ADD PRIMARY KEY (id)

      Doctrine seems to ignore existing columns.

      PHPUnit segfaults because of a backslash prepended to a FQCN and has a failure in the tests run so far (see attached PHPUnit output).

        Activity

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Matthias Lohr
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: