Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-244

Shema Tool is not working after DBAL-177 for postgresql (mysql working like before)

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.2, 2.2.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Ubuntu 10.10, Zend Server 5.5.0 with PHP 5.3.8

      Description

      After trying to upgrade 2.2.0 i found that schema tool wasn't working, so I switched back to 2.1.6, same thing with 2.2.1 and no bug report, so this is wats going on.

      ./doctrine orm:schema-tool:update --dump-sql # this will show full create table for schema even if tables are all ready there.

      After git bisectin Doctrine ORM project i found that commit ea5108ea0f35fc0f7ed3a740995a590926045c6e wast to blame, but that was only submodule update so made bisect for Doctrine DBAL:

      537de7ea6a34edbcc40bc6ca92e0a3f816b59330 .. 4410e4cec20b0f1f209578320e5b7d111e90c2a0 founding that 1ae87bf3e3ba93cb579a2a092b06b5a09b316542 was the problem.

      [margus@laptop doctrine-dbal ((4410e4c...))]$ git reset --hard 1ae87bf3e3ba93cb579a2a092b06b5a09b316542
      HEAD is now at 1ae87bf DBAL-177 - Make sure schema.table syntax is supported in Assets for quoted assets
      [margus@laptop doctrine-dbal ((1ae87bf...))]$ git submodule update --recursive
      Submodule path 'lib/vendor/doctrine-common': checked out 'd6e4c8b22af9800db4fd9d679ce98538da028168'

        1. shema tool printing full schema

      [margus@laptop doctrine-dbal ((1ae87bf...))]$ git reset --hard HEAD^1
      HEAD is now at bb84496 DBAL-144 - Dont throw exception when no primary key exists
      [margus@laptop doctrine-dbal ((bb84496...))]$ git submodule update --recursive

        1. works fine

      [margus@laptop build (master)]$ ./doctrine orm:schema-tool:update --dump-sql
      Nothing to update - your database is already in sync with the current entity metadata.

      with commit 1ae87bf3e3ba93cb579a2a092b06b5a09b316542 schema starts with 3 NULL lines, and then schema, with 2.2.0, extra "NULL" lines aren't there anymore.

      Using MySQL there isn't any problem, but with PostgreSQL (i have 8.4.11) this issue appears.

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Fixed, but couldn't verify as the previous statement worked for me.

        Show
        Benjamin Eberlei added a comment - Fixed, but couldn't verify as the previous statement worked for me.
        Hide
        Nikolai Spassoff added a comment -

        I'm experiencing the same issue.
        I looked at the mentioned commit and found out that the SQL query in getSchemaNames() does not return any namespaces.
        After some research I came with the following query to list all non-system namespaces in Postgres:

        SELECT nspname as schema_name FROM pg_namespace WHERE nspname !~ '^pg_.*' and nspname != 'information_schema'

        This fixed the issue for me and the schema-tool works again.

        Show
        Nikolai Spassoff added a comment - I'm experiencing the same issue. I looked at the mentioned commit and found out that the SQL query in getSchemaNames() does not return any namespaces. After some research I came with the following query to list all non-system namespaces in Postgres: SELECT nspname as schema_name FROM pg_namespace WHERE nspname !~ '^pg_.*' and nspname != 'information_schema' This fixed the issue for me and the schema-tool works again.
        Hide
        Benjamin Eberlei added a comment -

        Are you using Postgresql Schema? Can you provide some information about your database tables? I need some more information to try reproducing this.

        Show
        Benjamin Eberlei added a comment - Are you using Postgresql Schema? Can you provide some information about your database tables? I need some more information to try reproducing this.
        Hide
        Benjamin Eberlei added a comment -

        Increase priority, will be fixed this weekend and in the next bugifx release

        Show
        Benjamin Eberlei added a comment - Increase priority, will be fixed this weekend and in the next bugifx release

          People

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

            Dates

            • Created:
              Updated:
              Resolved: