<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Wed Jun 19 03:06:17 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-373/DBAL-373.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-373] Indexes and uniqueConstraints has been ignored</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-373</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;I using the Doctrine Migrations and when I declared my entity with the indexes section, the index name has been ignored. It&apos;s like this:&lt;/p&gt;

&lt;p&gt;indexes:&lt;br/&gt;
        IDX_ADDRESS_CITY:&lt;br/&gt;
            columns: city_id&lt;/p&gt;


&lt;p&gt;but, the diff tools ignore it and give me this code:&lt;br/&gt;
$this-&amp;gt;addSql(&quot;CREATE INDEX IDX_7299B5238BAC62AF ON tb_address (city_id)&quot;);&lt;/p&gt;

&lt;p&gt; and it should be:&lt;br/&gt;
$this-&amp;gt;addSql(&quot;CREATE INDEX IDX_ADDRESS_CITY ON tb_address (city_id)&quot;);&lt;/p&gt;

&lt;p&gt;Notice: I open the same bug on the migrations repository in github and @kimhemsoe told me to open here, since this is generated by DBAL component.&lt;/p&gt;</description>
                <environment>Ubuntu 12.04 with MySQL 5.5 and PHP 5.4</environment>
            <key id="14171">DBAL-373</key>
            <summary>Indexes and uniqueConstraints has been ignored</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="10000" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/needinfo.png">Awaiting Feedback</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="diegoholiveira">Diego Oliveira</reporter>
                        <labels>
                    </labels>
                <created>Fri, 26 Oct 2012 16:49:05 +0000</created>
                <updated>Sat, 20 Apr 2013 09:53:26 +0000</updated>
                                                                    <component>Schema Managers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="19123" author="posulliv" created="Tue, 11 Dec 2012 22:07:56 +0000"  >&lt;p&gt;Did you specify an index name in the indexes property for your entity in  your PHP file? In this case, you should have something like:&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-java&quot;&gt;
indexes={@Index(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;IDX_ADDRESS_CITY&quot;&lt;/span&gt;, columns={&lt;span class=&quot;code-quote&quot;&gt;&quot;city_id&quot;&lt;/span&gt;})}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That should result in the correct SQL being generated. If I modify the above to:&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-java&quot;&gt;
indexes={@Index(columns={&lt;span class=&quot;code-quote&quot;&gt;&quot;city_id&quot;&lt;/span&gt;})}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I also get a migration that has SQL with an auto-generated index name.&lt;/p&gt;</comment>
                    <comment id="19449" author="diegoholiveira" created="Sat, 2 Feb 2013 16:28:56 +0000"  >&lt;p&gt;Yes I did specify a name, as you can see:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;uniqueConstraints:
    UNIQUE_STATE_SLUG:
        columns: slug
indexes:
    IDX_USER_ADDRESS:
        columns: address_id
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;I don&apos;t try do to it using annotations because I choose do use yaml to describe my entities. I will take a look on the source code to see if I can fix it and send a PR.&lt;/p&gt;</comment>
                    <comment id="19930" author="diegoholiveira" created="Tue, 2 Apr 2013 12:45:40 +0000"  >&lt;p&gt;I already sent this patch to Guilherme Blanco, but I guess he doesn&apos;t have time to take a look on it.&lt;/p&gt;

&lt;p&gt;I guess my solution it&apos;s not ideal, but it solve the problem and can be a base to make a better solution.&lt;/p&gt;</comment>
                    <comment id="20076" author="beberlei" created="Sat, 20 Apr 2013 08:50:54 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=diegoholiveira&quot; class=&quot;user-hover&quot; rel=&quot;diegoholiveira&quot;&gt;Diego Oliveira&lt;/a&gt; the fix doesn&apos;t seem too nice with the additional boolean flag.&lt;/p&gt;

&lt;p&gt;I would rather like to fix the root cause instead of adding this solution.&lt;/p&gt;</comment>
                    <comment id="20077" author="beberlei" created="Sat, 20 Apr 2013 09:53:26 +0000"  >&lt;p&gt;The issue is tricky, because we cannot just move the index definitions above, they will need the columns, however that directly generates the index in the schema tool. Maybe if the gather join column methods would check if they can add an index already it would work.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11522" name="dbal-fixing-373.patch" size="3754" author="diegoholiveira" created="Tue, 2 Apr 2013 12:45:40 +0000" />
                    <attachment id="11523" name="orm-fixing-373.patch" size="1977" author="diegoholiveira" created="Tue, 2 Apr 2013 12:45:40 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>