Jira issue originally created by user margus:
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:
537de7e .. 4410e4c founding that 1ae87bf was the problem.
[margus@laptop doctrine-dbal ((4410e4c...))]$ git reset --hard 1ae87bf
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'
[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
[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 1ae87bf 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.
Comment created by @beberlei:
Increase priority, will be fixed this weekend and in the next bugifx release
Are you using Postgresql Schema? Can you provide some information about your database tables? I need some more information to try reproducing this.
Comment created by codingrobot:
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 schemaname FROM pg_namespace WHERE nspname !~ '^pg_.' and nspname != 'information*schema'
This fixed the issue for me and the schema-tool works again.
Fixed, but couldn't verify as the previous statement worked for me.
Issue was closed with resolution "Fixed"