<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Fri May 24 14:04:01 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/si/jira.issueviews:issue-xml/DBAL-510/DBAL-510.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[DBAL-510] Schema tool does not recognize existing columns</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-510</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;I&apos;m using doctrine with symfony. The first schema update is working, the table exists with all defined columns.&lt;br/&gt;
When i now run the schema update a second time (without code changes), doctrine tries to create the columns - but they already exists:&lt;/p&gt;

&lt;p&gt;$ php app/console doctrine:schema:update --dump-sql&lt;br/&gt;
CREATE SEQUENCE users_id_seq INCREMENT BY 1 MINVALUE 1 START 1;&lt;br/&gt;
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))&lt;br/&gt;
$ php app/console doctrine:schema:update --force&lt;br/&gt;
Updating database schema...&lt;br/&gt;
Database schema updated successfully! &quot;2&quot; queries were executed&lt;br/&gt;
$ php app/console doctrine:schema:update --dump-sql&lt;br/&gt;
ALTER TABLE users ADD id INT NOT NULL;&lt;br/&gt;
ALTER TABLE users ADD email VARCHAR(255) NOT NULL;&lt;br/&gt;
ALTER TABLE users ADD password VARCHAR(255) DEFAULT NULL;&lt;br/&gt;
ALTER TABLE users ADD salt VARCHAR(255) DEFAULT NULL;&lt;br/&gt;
ALTER TABLE users ADD realname VARCHAR(255) NOT NULL;&lt;br/&gt;
ALTER TABLE users ADD roles TEXT NOT NULL;&lt;br/&gt;
ALTER TABLE users ADD PRIMARY KEY (id)&lt;/p&gt;

&lt;p&gt;Doctrine seems to ignore existing columns.&lt;/p&gt;

&lt;p&gt;PHPUnit segfaults because of a backslash prepended to a FQCN and has a failure in the tests run so far (see attached PHPUnit output).&lt;/p&gt;</description>
                <environment>Ubuntu 8.04 with PHP 5.3.2 and PostgreSQL 8.4/9.1 (errors on both versions)</environment>
            <key id="14179">DBAL-510</key>
            <summary>Schema tool does not recognize existing columns</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="mlohr">Matthias Lohr</reporter>
                        <labels>
                    </labels>
                <created>Wed, 31 Oct 2012 16:43:18 +0000</created>
                <updated>Wed, 1 May 2013 12:22:31 +0000</updated>
                    <resolved>Wed, 1 May 2013 12:22:31 +0000</resolved>
                            <version>2.3</version>
                                <fixVersion>2.3.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="19229" author="beberlei" created="Sun, 6 Jan 2013 09:51:23 +0000"  >&lt;p&gt;Can i see your entity definition? This works normally, there must be something different in your environment.&lt;/p&gt;</comment>
                    <comment id="19232" author="mlohr" created="Sun, 6 Jan 2013 10:11:56 +0000"  >&lt;p&gt;I have the same problem in another project, so i&apos;ll give you the definitions from there. Here&apos;s the console output.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-none&quot;&gt;
$ php -v
PHP 5.3.10-1ubuntu3.4 with Suhosin-Patch (cli) (built: Sep 12 2012 18:59:41) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

$ psql --version
psql (PostgreSQL) 9.1.7
contains support for command-line editing

$ php app/console doctrine:schema:update --dump-sql
CREATE TABLE invoices (id INT NOT NULL, number VARCHAR(255) NOT NULL, PRIMARY KEY(id));
CREATE TABLE items (id INT NOT NULL, label VARCHAR(255) NOT NULL, price DOUBLE PRECISION DEFAULT NULL, withTax BOOLEAN NOT NULL, PRIMARY KEY(id));
CREATE TABLE clients (id INT NOT NULL, label VARCHAR(255) NOT NULL, PRIMARY KEY(id))

$ php app/console doctrine:schema:update --force
Updating database schema...
Database schema updated successfully! &quot;3&quot; queries were executed

$ php app/console doctrine:schema:update --dump-sql
ALTER TABLE invoices ADD id INT NOT NULL;
ALTER TABLE invoices ADD number VARCHAR(255) NOT NULL;
ALTER TABLE invoices ADD PRIMARY KEY (id);
ALTER TABLE items ADD id INT NOT NULL;
ALTER TABLE items ADD label VARCHAR(255) NOT NULL;
ALTER TABLE items ADD price DOUBLE PRECISION DEFAULT NULL;
ALTER TABLE items ADD withTax BOOLEAN NOT NULL;
ALTER TABLE items ADD PRIMARY KEY (id);
ALTER TABLE clients ADD id INT NOT NULL;
ALTER TABLE clients ADD label VARCHAR(255) NOT NULL;
ALTER TABLE clients ADD PRIMARY KEY (id)

$ php app/console doctrine:schema:update --force
Updating database schema...
                                                                   
  [Doctrine\DBAL\DBALException]                                                                   
  An exception occurred while executing &apos;ALTER TABLE invoices ADD id INT NOT NULL&apos;:               
                                                                                                  
  SQLSTATE[42701]: Duplicate column: 7 ERROR:  column &quot;id&quot; of relation &quot;invoices&quot; already exists  
                                                                                                  
                                                                                      
  [PDOException]                                                                                  
  SQLSTATE[42701]: Duplicate column: 7 ERROR:  column &quot;id&quot; of relation &quot;invoices&quot; already exists  
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Client.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&amp;lt;?php

namespace LohrTec\PureInvoiceBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;clients&quot;&lt;/span&gt;)
 */
class Client {

	/**
	 * client id
	 *
	 * @ORM\Id
	 * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;

	/**
	 * client label
	 *
	 * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $label;


	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getId() {
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;id;
	}

	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getLabel() {
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;label;
	}

	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setLabel($label) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;label = $label;
	}

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Invoice.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&amp;lt;?php

namespace LohrTec\PureInvoiceBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;invoices&quot;&lt;/span&gt;)
 */
class Invoice {

	/**
	 * client id
	 *
	 * @ORM\Id
	 * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;

	/**
	 * invoice number
	 *
	 * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $number;

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Item.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&amp;lt;?php

namespace LohrTec\PureInvoiceBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;items&quot;&lt;/span&gt;)
 */
class Item {

	/**
	 * item id
	 *
	 * @ORM\Id
	 * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
	 * @ORM\GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;AUTO&quot;&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;

	/**
	 * item label
	 *
	 * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $label = &apos;&apos;;

	/**
	 * item &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt; price
	 *
	 * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-object&quot;&gt;float&lt;/span&gt;&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;float&lt;/span&gt;
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $price = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

	/**
	 * &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;: pre tax price, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;: post tax price
	 *
	 * @ORM\Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;&quot;&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $withTax = 1;

	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct($label, $price = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, $withTax = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setLabel($label);
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;setPrice($price, $withTax);
	}

	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getId() {
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;id;
	}

	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getLabel() {
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;label;
	}

	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getPrice() {
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;price;
	}

	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function priceIsTaxed() {
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;withTax;
	}

	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setLabel($label) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;label = $label;
	}

	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setPrice($price, $withTax = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;price = $price;
		&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($withTax !== &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;withTax = ($withTax?&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;:&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;);
	}

	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setPriceIsTaxed($isTaxed) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;withTax = $isTaxed;
	}

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="20016" author="adrienbrault" created="Mon, 15 Apr 2013 15:53:16 +0000"  >&lt;p&gt;This happens when the schema in which your tables are, is the first one in the list of `show search_path;`.&lt;br/&gt;
A simple workaround I&apos;m using is to add a dumb schema at the beginning of search_path `ALTER USER youruser SET search_path = foo,yourschema,public;`.&lt;/p&gt;</comment>
                    <comment id="20017" author="adrienbrault" created="Mon, 15 Apr 2013 15:55:30 +0000"  >&lt;p&gt;FYI, \Doctrine\DBAL\Platforms\PostgreSqlPlatform::getTableWhereClause doesnt seem to work when the $table has no &quot;.&quot; in it. (Which happen when the schema is the first in the search_path ...).&lt;/p&gt;</comment>
                    <comment id="20018" author="mlohr" created="Mon, 15 Apr 2013 16:04:29 +0000"  >&lt;p&gt;Hey, thank you very much for for your information!&lt;/p&gt;</comment>
                    <comment id="20019" author="mlohr" created="Mon, 15 Apr 2013 16:25:50 +0000"  >&lt;p&gt;Ok, it&apos;s not the problem with the position of your schema, but the default schema is &quot;$user&quot; and that seems not to be parsed/replaced with the username! &apos;ALTER USER youruser SET search_path TO yoursearchpath, public;&apos; works for me.&lt;/p&gt;</comment>
                    <comment id="20020" author="mlohr" created="Mon, 15 Apr 2013 16:40:58 +0000"  >&lt;p&gt;Fixed it (&lt;a href=&quot;https://github.com/doctrine/dbal/pull/305&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/pull/305&lt;/a&gt;).&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11340" name="phpunit_with_tap.txt" size="68817" author="mlohr" created="Wed, 31 Oct 2012 16:43:18 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>