Doctrine Projecthttp://www.doctrine-project.org/jira
This file is an XML representation of an issueen-us6.2.3626015-04-2014[DBAL-244] Shema Tool is not working after DBAL-177 for postgresql (mysql working like before)http://www.doctrine-project.org/jira/browse/DBAL-244
Doctrine DBAL<p>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.</p>
<p>./doctrine orm:schema-tool:update --dump-sql # this will show full create table for schema even if tables are all ready there.</p>
<p>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:</p>
<p>537de7ea6a34edbcc40bc6ca92e0a3f816b59330 .. 4410e4cec20b0f1f209578320e5b7d111e90c2a0 founding that 1ae87bf3e3ba93cb579a2a092b06b5a09b316542 was the problem.</p>
<p><span class="error">&#91;margus@laptop doctrine-dbal ((4410e4c...))&#93;</span>$ git reset --hard 1ae87bf3e3ba93cb579a2a092b06b5a09b316542<br/>
HEAD is now at 1ae87bf <a href="http://www.doctrine-project.org/jira/browse/DBAL-177" title="Have Schema Assets handle &quot;foo.bar&quot; syntax correctly." class="issue-link" data-issue-key="DBAL-177"><del>DBAL-177</del></a> - Make sure schema.table syntax is supported in Assets for quoted assets<br/>
<span class="error">&#91;margus@laptop doctrine-dbal ((1ae87bf...))&#93;</span>$ git submodule update --recursive<br/>
Submodule path 'lib/vendor/doctrine-common': checked out 'd6e4c8b22af9800db4fd9d679ce98538da028168'</p>
<ol>
<li>
<ol>
<li>shema tool printing full schema</li>
</ol>
</li>
</ol>
<p><span class="error">&#91;margus@laptop doctrine-dbal ((1ae87bf...))&#93;</span>$ git reset --hard HEAD^1<br/>
HEAD is now at bb84496 <a href="http://www.doctrine-project.org/jira/browse/DBAL-144" title="Oracle tables without indices are not handled during convert - this behavior should be tolerant since Oracle does not require indicies." class="issue-link" data-issue-key="DBAL-144"><del>DBAL-144</del></a> - Dont throw exception when no primary key exists<br/>
<span class="error">&#91;margus@laptop doctrine-dbal ((bb84496...))&#93;</span>$ git submodule update --recursive</p>
<ol>
<li>
<ol>
<li>works fine</li>
</ol>
</li>
</ol>
<p><span class="error">&#91;margus@laptop build (master)&#93;</span>$ ./doctrine orm:schema-tool:update --dump-sql<br/>
Nothing to update - your database is already in sync with the current entity metadata.</p>
<p>with commit 1ae87bf3e3ba93cb579a2a092b06b5a09b316542 schema starts with 3 NULL lines, and then schema, with 2.2.0, extra "NULL" lines aren't there anymore.</p>
<p>Using MySQL there isn't any problem, but with PostgreSQL (i have 8.4.11) this issue appears. </p>Ubuntu 10.10, Zend Server 5.5.0 with PHP 5.3.8DBAL-244Shema Tool is not working after DBAL-177 for postgresql (mysql working like before)BugCriticalResolvedFixedBenjamin EberleiMargus SipriaSun, 25 Mar 2012 22:19:29 +0000Thu, 17 Apr 2014 05:31:09 +0000Sat, 5 May 2012 08:01:06 +00002.22.2.101<p>Increase priority, will be fixed this weekend and in the next bugifx release</p><p>Are you using Postgresql Schema? Can you provide some information about your database tables? I need some more information to try reproducing this.</p><p>I'm experiencing the same issue.<br/>
I looked at the mentioned commit and found out that the SQL query in getSchemaNames() does not return any namespaces.<br/>
After some research I came with the following query to list all non-system namespaces in Postgres:</p>
<p>SELECT nspname as schema_name FROM pg_namespace WHERE nspname !~ '^pg_.*' and nspname != 'information_schema'</p>
<p>This fixed the issue for me and the schema-tool works again.</p><p>Fixed, but couldn't verify as the previous statement worked for me.</p>