<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Thu Jun 20 12:06:03 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/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+DC+AND+resolution+%3D+Unresolved+AND+component+%3D+%22Import%2FExport%22+ORDER+BY+priority+DESC&tempMax=1000&field=key&field=summary
-->
<!-- If you wish to do custom client-side styling of RSS, uncomment this:
<?xml-stylesheet href="http://www.doctrine-project.org/jira/styles/jiraxml2html.xsl" type="text/xsl"?>
-->
<rss version="0.92">
    <channel>
        <title>Doctrine Project</title>
        <link>http://www.doctrine-project.org/jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project+%3D+DC+AND+resolution+%3D+Unresolved+AND+component+%3D+%22Import%2FExport%22+ORDER+BY+priority+DESC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="38" total="38"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DC-743] Incompatibilty between fixture import and accessors extends</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-743</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;I had a problem when i try to import data with an extended accessors when i try to insert a content with a relation. I discovered this problem in symfony.&lt;/p&gt;

&lt;p&gt;For example, here is my table :&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; 
News:
  tableName: ne_news
  columns:
    id:           { type: integer(4), primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
    author_id:    { type: integer(4), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
    name:         { type: string(255) }
    description:  { type: text }
  relations:
    author: { class: sfGuardUser, onDelete: NULL, local: author_id, foreign: id, foreignAlias: sfGuardUser }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And the fixture :&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; 
SfGuardUser:
  sadmin:
    username:       admin
    password:       admin
    is_super_admin: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
  author1:
    username: myname
    
News:
  News1:
    name: Test 1
    description: Description of news 1
    author: author1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I import it with  symfony doctrine:data-load and it works.&lt;/p&gt;

&lt;p&gt;If i add a news.class.php and extends the autogenerated class it fails.&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; 
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setAuthor($v)
    {
        &lt;span class=&quot;code-comment&quot;&gt;//__log(&apos;extending setter&apos;);
&lt;/span&gt;        &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;_set(&apos;author&apos;, $v);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;WhenDoctrine_Data_Import finds the setAuthor function, it wont transform author1 in object so $v will be a string, not an sfGuardUser object. &lt;/p&gt;

&lt;p&gt;What do you think? Is a common behavior, how can i extends my accessor?&lt;/p&gt;</description>
                <environment>Window, PHP5, Symfony</environment>
            <key id="11508">DC-743</key>
            <summary>Incompatibilty between fixture import and accessors extends</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="bricef">Brice Favre</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Jun 2010 11:06:58 +0000</created>
                <updated>Fri, 22 Jul 2011 02:28:49 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Data Fixtures</component>
                <component>Import/Export</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="16190" author="ryan" created="Fri, 22 Jul 2011 02:28:49 +0000"  >&lt;p&gt;this is the same issue as &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-735&quot; class=&quot;external-link&quot;&gt;DC-735&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-735] Imported objects not converted to objects and parsed as string when a setter method exists</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-735</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If you set a setter method for a model which is for a relation the data import no longer works. This seems to be because in the _processRow method it checks if a method exists and then passes the default value rather than checking whether a relation exists first and passing the imported object. &lt;/p&gt;

&lt;p&gt;This effectively means you can&apos;t overload a setter method and still use the data import. &lt;/p&gt;</description>
                <environment>Mac OS X 10.6</environment>
            <key id="11492">DC-735</key>
            <summary>Imported objects not converted to objects and parsed as string when a setter method exists</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="kev">Kevin Dew</reporter>
                        <labels>
                    </labels>
                <created>Mon, 14 Jun 2010 17:32:09 +0000</created>
                <updated>Fri, 22 Jul 2011 05:09:34 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16191" author="ryan" created="Fri, 22 Jul 2011 05:09:34 +0000"  >&lt;p&gt;added testcase here&lt;br/&gt;
&lt;a href=&quot;https://github.com/rahx/doctrine1/commit/ba5628abaa5b3d60638d833d90b1cf439504d560&quot; class=&quot;external-link&quot;&gt;https://github.com/rahx/doctrine1/commit/ba5628abaa5b3d60638d833d90b1cf439504d560&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-919] Import/Pgsql.php: listTableColumns - SQL failure with PostgreSQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-919</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;this issue was reported at the symfony project which uses Doctrine 1.2.3: &lt;br/&gt;
&lt;a href=&quot;http://trac.symfony-project.org/ticket/9152&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/9152&lt;/a&gt;&lt;br/&gt;
&quot;php symfony doctrine:build-schema failure with PostgreSQL for 1.4.7 and 1.4.8 version&quot;&lt;/p&gt;

&lt;p&gt;The SQL Statement &apos;listTableColumns&apos; fails with an SQL-Error &quot;missing from-clause&quot;&lt;br/&gt;
&lt;a href=&quot;http://trac.doctrine-project.org/browser/tags/1.2.3/lib/Doctrine/Import/Pgsql.php#L96&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/browser/tags/1.2.3/lib/Doctrine/Import/Pgsql.php#L96&lt;/a&gt;&lt;br/&gt;
I can reproduce the error directly in psql or pgadmin. The SQL Statement seems related to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-697&quot; title=&quot;Doctrine Support of custom enum types in Pgsql&quot;&gt;&lt;del&gt;DC-697&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Even when i turn on the add_missing_from option on the postgres-server it fails with &quot;missing relation&quot;.&lt;/p&gt;

&lt;p&gt;Now it seems to me, you already fixed this bug in the current 1.2 branch, because the current SQL-Statement is different and it works for me in psql/pgadmin.&lt;br/&gt;
&lt;a href=&quot;http://trac.doctrine-project.org/browser/branches/1.2/lib/Doctrine/Import/Pgsql.php#L96&quot; class=&quot;external-link&quot;&gt;http://trac.doctrine-project.org/browser/branches/1.2/lib/Doctrine/Import/Pgsql.php#L96&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Could you please close this ticket, if you already fixed this issue, or confirm if it&apos;s still an issue?&lt;br/&gt;
Attached you find my proposed patch at the symfony project . the current statement in the branch looks too different from my version, so i am not sure to use this patch directly. Tell me if I should work out a proper patch.&lt;/p&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;error&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;SQLSTATE[42P01]: Undefined table: 7 ERROR:  missing FROM-clause entry &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; table &lt;span class=&quot;code-quote&quot;&gt;&quot;t&quot;&lt;/span&gt;                                               
 	  LINE 6: ...                                                  t.typtype ...                                                       
 	                                                               ^. Failing Query: &quot;SELECT                                           
 	                                                       ordinal_position as attnum,                                                 
 	                                                       column_name as field,                                                       
 	                                                       udt_name as type,                                                           
 	                                                       data_type as complete_type,                                                 
 	                                                       t.typtype AS typtype,                                                       
 	                                                       is_nullable as isnotnull,                                                   
 	                                                       column_default as &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;,                                                   
 	                                                       (                                                                           
 	                                                         SELECT &apos;t&apos;                                                                 
 	                                                           FROM pg_index, pg_attribute a, pg_class c, pg_type t                     
 	                                                           WHERE c.relname = table_name AND a.attname = column_name                 
 	                                                           AND a.attnum &amp;gt; 0 AND a.attrelid = c.oid AND a.atttypid = t.oid           
 	                                                           AND c.oid = pg_index.indrelid AND a.attnum = ANY (pg_index.indkey)       
 	                                                           AND pg_index.indisprimary = &apos;t&apos;                                         
 	                                                           AND format_type(a.atttypid, a.atttypmod) NOT LIKE &apos;information_schema%&apos; 
 	                                                       ) as pri,                                                                   
 	                                                       character_maximum_length as length                                           
 	                                                     FROM information_schema.COLUMNS                                               
 	                                                     WHERE table_name = &apos;matable&apos;                                   
 	                                                     ORDER BY ordinal_position&quot;  
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Postgres Import Schema&lt;br/&gt;
</environment>
            <key id="12075">DC-919</key>
            <summary>Import/Pgsql.php: listTableColumns - SQL failure with PostgreSQL</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="christian_vogel">Christian Vogel</reporter>
                        <labels>
                    </labels>
                <created>Sun, 7 Nov 2010 04:49:56 +0000</created>
                <updated>Mon, 9 Apr 2012 14:17:24 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>4</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="14691" author="nahuelon" created="Tue, 9 Nov 2010 10:43:50 +0000"  >&lt;p&gt;We apply the diff patch you submit and works perfect. We are using Doctrine 1.2.3 with PostgreSQL 8.4.&lt;br/&gt;
We could generates models from database with generateModelsFromDb() method.&lt;br/&gt;
Please add this patch to a new release.&lt;br/&gt;
Thank you very much.&lt;/p&gt;</comment>
                    <comment id="14803" author="tim.hemming@spgroup.co.uk" created="Tue, 23 Nov 2010 07:15:21 +0000"  >&lt;p&gt;We have applied this patch directly to our server-wide Doctrine library and it works fine. We look forward to it becoming a part of the Doctrine distribution.&lt;/p&gt;</comment>
                    <comment id="14981" author="chotchki" created="Sun, 19 Dec 2010 01:56:38 +0000"  >&lt;p&gt;I can confirm that this bug also affects symfony 1.4.8 and the attached fix works perfectly!&lt;/p&gt;</comment>
                    <comment id="15361" author="dla" created="Mon, 21 Feb 2011 06:51:30 +0000"  >&lt;p&gt;Confirmed to fix crash with symfony 1.3.8&lt;/p&gt;</comment>
                    <comment id="17833" author="koyot" created="Mon, 9 Apr 2012 14:17:24 +0000"  >&lt;p&gt;I use the version 1.4.17 and also had the error with postgres 9.1. Applying the correction suggested in DIFF. The system worked.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10847" name="trac_9152_patch_for_Pgsql.php.diff" size="5112" author="christian_vogel" created="Sun, 7 Nov 2010 04:49:56 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-898] (PATCH) Migration fails when addColumn with type &apos;boolean&apos; used with default value, resulting in incorrect &apos;ALTER TABLE&apos; query in MySQL</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-898</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I use MySQL. In my up() method in migration class, I have:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;addColumn($table, &apos;is_master&apos;, &apos;boolean&apos;, null, array(&apos;notnull&apos; =&amp;gt; true, &apos;default&apos; =&amp;gt; false));&lt;/p&gt;

&lt;p&gt;Running &apos;migrate&apos; results in a following exception:&lt;br/&gt;
 Error #1 - SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 1067 Invalid default value for &apos;is_master&apos;. Failing Query: &quot;ALTER TABLE books_authors ADD is_master TINYINT(1) DEFAULT &apos;&apos; NOT NULL&quot;&lt;br/&gt;
#0 /usr/local/zend/share/pear/Doctrine/Connection.php(1025): Doctrine_Connection-&amp;gt;rethrowException(Object(PDOException), Object(Doctrine_Connection_Mysql), &apos;ALTER TABLE boo...&apos;)&lt;br/&gt;
#1 /usr/local/zend/share/pear/Doctrine/Export.php(621): Doctrine_Connection-&amp;gt;execute(&apos;ALTER TABLE boo...&apos;)&lt;br/&gt;
#2 /usr/local/zend/share/pear/Doctrine/Migration/Process.php(89): Doctrine_Export-&amp;gt;alterTable(&apos;books_authors&apos;, Array)&lt;br/&gt;
#3 /usr/local/zend/share/pear/Doctrine/Migration.php(522): Doctrine_Migration_Process-&amp;gt;processCreatedColumn(Array)&lt;br/&gt;
#4 /usr/local/zend/share/pear/Doctrine/Migration.php(479): Doctrine_Migration-&amp;gt;_doMigrateStep(&apos;up&apos;, 1)&lt;br/&gt;
#5 /usr/local/zend/share/pear/Doctrine/Migration.php(328): Doctrine_Migration-&amp;gt;_doMigrate(1)&lt;br/&gt;
#6 /usr/local/zend/share/pear/Doctrine/Core.php(1016): Doctrine_Migration-&amp;gt;migrate(NULL)&lt;br/&gt;
#7 /usr/local/zend/share/pear/Doctrine/Task/Migrate.php(41): Doctrine_Core::migrate(&apos;/Users/argasek/...&apos;, NULL)&lt;br/&gt;
#8 /usr/local/zend/share/pear/Doctrine/Cli.php(516): Doctrine_Task_Migrate-&amp;gt;execute()&lt;br/&gt;
#9 /usr/local/zend/share/pear/Doctrine/Cli.php(498): Doctrine_Cli-&amp;gt;executeTask(Object(Doctrine_Task_Migrate), Array)&lt;br/&gt;
#10 /usr/local/zend/share/pear/Doctrine/Cli.php(452): Doctrine_Cli-&amp;gt;_run(Array)&lt;br/&gt;
#11 /Users/argasek/Sites/blipoteka/scripts/doctrine-cli.php(28): Doctrine_Cli-&amp;gt;run(Array)&lt;br/&gt;
#12 &lt;/p&gt;
{main}

&lt;p&gt;However, I would expect ALTER query to look like this:&lt;/p&gt;

&lt;p&gt;ALTER TABLE books_authors ADD is_master TINYINT(1) DEFAULT 0 NOT NULL&lt;/p&gt;

&lt;p&gt;I guess there&apos;s a problem with getDefaultFieldDeclaration() in Doctrine_Export_Mysql, it lacks convertBooleans() call being present at Doctrine_Export.&lt;/p&gt;</description>
                <environment>Mac OS X 10.6 Snow Leopard / Zend Server CE 5.0.3 (irrelevant)</environment>
            <key id="12026">DC-898</key>
            <summary>(PATCH) Migration fails when addColumn with type &apos;boolean&apos; used with default value, resulting in incorrect &apos;ALTER TABLE&apos; query in MySQL</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="argasek">Jakub Argasi&#324;ski</reporter>
                        <labels>
                    </labels>
                <created>Fri, 22 Oct 2010 08:02:33 +0000</created>
                <updated>Fri, 22 Oct 2010 08:02:33 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10830" name="fix_boolean_default_mysql_column_migration.patch" size="525" author="argasek" created="Fri, 22 Oct 2010 08:02:33 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-892] Typo. in Import/Pgsql.php</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-892</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;There is maybe a typo. l. 194 in Doctrine/Import/Pgsql.php : typtype should be type?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</description>
                <environment>Linux and symfony1.4.9</environment>
            <key id="12014">DC-892</key>
            <summary>Typo. in Import/Pgsql.php</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="nippo">Nicolas Ippolito</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Oct 2010 04:41:23 +0000</created>
                <updated>Thu, 31 Mar 2011 06:42:50 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15644" author="leszczu" created="Thu, 31 Mar 2011 06:42:50 +0000"  >&lt;p&gt;Happens to me as well, on windows.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-871] When importing fixtures some times the fixtures will be loaded in the wrong order causing broken foreign key relations</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-871</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi&lt;/p&gt;

&lt;p&gt;I recently encountered a problem when importing fixtures. I was ending up with invalid foreign key constraints due to the fact that the fixtures were importing in the wrong order. I tracked down the problem and figured out that the method Doctrine_Connection_UnitOfWork::buildFlushTree, while a truly impressive piece of sorting logic still some times still gets the order of the classes wrong in its end result.&lt;/p&gt;

&lt;p&gt;I realized that all it needed though was a second shot at reordering the list &amp;#8211; in other words it needed to exhaustively try to order the list until it found that everything was in the right order.&lt;/p&gt;

&lt;p&gt;I put in a for loop in this method that will keep running until no order changes occurred or until a max number of attempts have been reached. The max number of attempts I added as a property of Doctrine_Connection called: maxBuildFlushTreeOrderAttempts.&lt;/p&gt;

&lt;p&gt;This has solved my problem. I wouldn&apos;t be surprised if this was a common issue.&lt;/p&gt;

&lt;p&gt;I will post my patch into this thread.&lt;/p&gt;

&lt;p&gt;Hope all is well.&lt;/p&gt;

&lt;p&gt;Will Ferrer&lt;/p&gt;</description>
                <environment>XP Xamp</environment>
            <key id="11935">DC-871</key>
            <summary>When importing fixtures some times the fixtures will be loaded in the wrong order causing broken foreign key relations</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="willf1976">will ferrer</reporter>
                        <labels>
                    </labels>
                <created>Mon, 20 Sep 2010 22:26:01 +0000</created>
                <updated>Mon, 20 Sep 2010 22:34:45 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14426" author="willf1976" created="Mon, 20 Sep 2010 22:34:45 +0000"  >&lt;p&gt;Here is the patch&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10805" name="DC_871_fix.patch" size="10326" author="willf1976" created="Mon, 20 Sep 2010 22:34:45 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-865] Models that extend a baseclass other than Doctrine_Record treat that baseclass as if it were a model</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-865</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;We recently made an extended version of Docrtine_Record which has some functionality that is specific to our project and we switched all our models to use this baseclass by setting the cli option: generate_models_options:baseClassName&lt;/p&gt;

&lt;p&gt;We found that when we rebuilt our db this base class was being treated as it were a model (even though its an abstract class). This was causing some errors during our build and a table based on the name of the baseclass was being created.&lt;/p&gt;

&lt;p&gt;I tracked the problem down to line 310 of Doctrine_Table where the do loop was only breaking for a class named &quot;Doctrine_Record&quot;.&lt;/p&gt;

&lt;p&gt;It seemed to make more sense to me to have this loop break for any abstract class, so I copied the technique used to check for abstract classes from Doctrine_Core Line 798. This broke a lot of tests however so due to time constraints I went with a simpler fix &amp;#8211; instead I just changed the code that checks if the class is named &quot;Doctrine_Record&quot; to be a regular expression that checks to see if the class name starts with &quot;Doctrine_Record&quot; optionally followed by an underscore + more text in the class name.&lt;/p&gt;

&lt;p&gt;This has fixed my issue and should let people make extensions of doctrine record which they can use as a baseclass provided that their class names indicate that they are extending Doctrine_Record.&lt;/p&gt;

&lt;p&gt;The only problem I can see arising from this if some users have made models that they have named starting with &quot;Doctrine_Record&quot;, but that seems like it would be an odd thing to do so this probably it won&apos;t be an issue.&lt;/p&gt;

&lt;p&gt;I could however look more closely into detecting abstract classes if this would make my changes significantly more useful.&lt;/p&gt;

&lt;p&gt;Please see attached patch.&lt;/p&gt;

&lt;p&gt;Will Ferrer&lt;/p&gt;</description>
                <environment>XP Windows</environment>
            <key id="11912">DC-865</key>
            <summary>Models that extend a baseclass other than Doctrine_Record treat that baseclass as if it were a model</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="willf1976">will ferrer</reporter>
                        <labels>
                    </labels>
                <created>Sat, 11 Sep 2010 19:42:56 +0000</created>
                <updated>Sat, 11 Sep 2010 19:47:56 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Cli</component>
                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14345" author="willf1976" created="Sat, 11 Sep 2010 19:47:56 +0000"  >&lt;p&gt;Here is the patch&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10791" name="DC_865_fix.patch" size="531" author="willf1976" created="Sat, 11 Sep 2010 19:47:56 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1013] [PATCH] Doctrine ignores unique option for integers (PostgreSQL)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1013</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This issue is exactly the same as &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-252&quot; title=&quot;Doctrine ignores UNIQUE:true on int&quot;&gt;&lt;del&gt;DC-252&lt;/del&gt;&lt;/a&gt;, but refers to  PostgreSQL&lt;/p&gt;</description>
                <environment></environment>
            <key id="12761">DC-1013</key>
            <summary>[PATCH] Doctrine ignores unique option for integers (PostgreSQL)</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="rybakit">Eugene Leonovich</reporter>
                        <labels>
                    </labels>
                <created>Wed, 29 Jun 2011 11:42:21 +0000</created>
                <updated>Thu, 18 Aug 2011 08:05:21 +0000</updated>
                                                                    <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16349" author="m" created="Thu, 18 Aug 2011 08:05:21 +0000"  >&lt;p&gt;Your patch fixed the problem for me. Thanks!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11019" name="integer_unique.patch" size="832" author="rybakit" created="Wed, 29 Jun 2011 11:42:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1004] ATTR_TBLNAME_FORMAT not used when creating models from database</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1004</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;if you set prefix to &quot;xyz_%s&quot; and have the model &quot;BackgroundColor&quot; it will become the table =&amp;gt; &quot;xyz_background_color&quot;&lt;br/&gt;
if you have the table &quot;xyz_background_color&quot; with unknown model and create the the model from the table, you will get =&amp;gt; &quot;XyzBackgroundColor&quot;.&lt;/p&gt;

&lt;p&gt;The fix (diff):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;368a369,370&lt;br/&gt;
&amp;gt;         $tablePrefix = $manager-&amp;gt;getAttribute(Doctrine_Core::ATTR_TBLNAME_FORMAT);&lt;br/&gt;
&amp;gt;         &lt;br/&gt;
381d382&lt;br/&gt;
&amp;lt; &lt;br/&gt;
385c386&lt;br/&gt;
&amp;lt;               $definition&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;className&amp;#39;&amp;#93;&lt;/span&gt; = Doctrine_Inflector::classify(Doctrine_Inflector::tableize($table));&lt;br/&gt;
&amp;#8212;&lt;br/&gt;
&amp;gt;               $definition&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;className&amp;#39;&amp;#93;&lt;/span&gt; = Doctrine_Inflector::classify(Doctrine_Inflector::tableize(preg_replace(sprintf(&apos;/\A%s\z/&apos;, str_replace(&apos;%s&apos;, &apos;(.*?)&apos;, $tablePrefix)), &apos;$1&apos;, $table)));&lt;br/&gt;
396c397&lt;br/&gt;
&amp;lt;                       $class = Doctrine_Inflector::classify(Doctrine_Inflector::tableize($table));&lt;br/&gt;
&amp;#8212;&lt;br/&gt;
&amp;gt;                       $class = Doctrine_Inflector::classify(Doctrine_Inflector::tableize(preg_replace(sprintf(&apos;/\A%s\z/&apos;, str_replace(&apos;%s&apos;, &apos;(.*?)&apos;, $tablePrefix)), &apos;$1&apos;, $table)));&lt;/p&gt;&lt;/blockquote&gt;</description>
                <environment></environment>
            <key id="12621">DC-1004</key>
            <summary>ATTR_TBLNAME_FORMAT not used when creating models from database</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="to-rparker">Robin Parker</reporter>
                        <labels>
                    </labels>
                <created>Sun, 8 May 2011 04:34:20 +0000</created>
                <updated>Sun, 8 May 2011 04:34:52 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.3</fixVersion>
                <fixVersion>1.2.4</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15814" author="to-rparker" created="Sun, 8 May 2011 04:34:52 +0000"  >&lt;p&gt;The diff output as .diff&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10990" name="doctrine_bug_diff.diff" size="746" author="to-rparker" created="Sun, 8 May 2011 04:34:52 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-955] Loading fixtures containing data for Versionable/Searchable Models fails due to Duplicate-Key errors</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-955</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Sample schema:&lt;/p&gt;

&lt;p&gt;Blog:&lt;br/&gt;
  actAs: &lt;span class=&quot;error&quot;&gt;&amp;#91;Versionable, Searchable&amp;#93;&lt;/span&gt;&lt;br/&gt;
  columns:&lt;br/&gt;
   id: &lt;/p&gt;
{ type: integer, primary: true, autoincrement: true }
&lt;p&gt;   name: string&lt;br/&gt;
   text: text&lt;/p&gt;

&lt;p&gt;When dumping data of a schema with Versionable and/or Searchable Behaviour, the dump.yml will contain all data, including the *_version and *_index tables.&lt;/p&gt;

&lt;p&gt;Trying to load the same .yml file results in Duplicate-Key constraint violations, as long as the data for the *_version and *_index tables is present.&lt;br/&gt;
The import is only successfull, when the data for these tables is discarded.&lt;br/&gt;
This leads to the issue, that one can only do a dump-load cycle, when the complete version history of a Model is discarded. Which makes dump-load for such models rather useless.&lt;/p&gt;</description>
                <environment>PHP 5.3.3 / symfony 1.4.9-dev / MySQL 5.0</environment>
            <key id="12301">DC-955</key>
            <summary>Loading fixtures containing data for Versionable/Searchable Models fails due to Duplicate-Key errors</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="bigbadbassman">Daniel Reiche</reporter>
                        <labels>
                    </labels>
                <created>Fri, 14 Jan 2011 04:38:57 +0000</created>
                <updated>Fri, 14 Jan 2011 04:42:12 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Behaviors</component>
                <component>Data Fixtures</component>
                <component>Import/Export</component>
                <component>Searchable</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-941] Spatial index type for mysql</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-941</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;m using doctrine and some of mysql&apos;s spatial functions. I need to specify spatial index for my tables.&lt;br/&gt;
My declaration looks like:&lt;/p&gt;

&lt;p&gt;Geometry:&lt;br/&gt;
  tableName: geometry&lt;br/&gt;
  options:&lt;br/&gt;
    type:    MyISAM&lt;br/&gt;
    collate: utf8_unicode_ci&lt;br/&gt;
    charset: utf8&lt;br/&gt;
  columns:&lt;br/&gt;
    id: &lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      primary: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
    geometry:&lt;br/&gt;
      type: geometry&lt;br/&gt;
      notnull: true&lt;br/&gt;
   indexes:&lt;br/&gt;
    geometry:&lt;br/&gt;
      fields:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;geometry&lt;br/&gt;
      type: spatial&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Exporting this definitions throws an exception: Unknown type spatial for index geometry_idx&lt;/p&gt;

</description>
                <environment></environment>
            <key id="12178">DC-941</key>
            <summary>Spatial index type for mysql</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mishal">Mishal</reporter>
                        <labels>
                    </labels>
                <created>Mon, 29 Nov 2010 14:43:57 +0000</created>
                <updated>Mon, 29 Nov 2010 14:43:57 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.3</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10880" name="patch.patch" size="736" author="mishal" created="Mon, 29 Nov 2010 14:43:57 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1036] Doctrine_Export_Oracle::alterTable() not properly quoting column identifier for change</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1036</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This bug was introduced by the person reporting the bug #&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-592&quot; title=&quot;PHP Fatal error:  Call to undefined method Doctrine_Connection_Oracle::getDeclaration() in  ....\Doctrine\Export\Oracle.php on line 501&quot;&gt;&lt;del&gt;DC-592&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;When trying to generate an ALTER TABLE statement with &lt;tt&gt;Doctrine_Core::ATTR_QUOTE_IDENTIFIER&lt;/tt&gt; enabled, the column identifier is not quoted, and a blank identifier is instead quoted, generating the following SQL:&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;ALTER TABLE &lt;span class=&quot;code-quote&quot;&gt;&quot;mytable&quot;&lt;/span&gt; MODIFY (username &quot;&quot; VARCHAR2(200))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The proper SQL to be generated should be:&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;ALTER TABLE &lt;span class=&quot;code-quote&quot;&gt;&quot;mytable&quot;&lt;/span&gt; MODIFY (&lt;span class=&quot;code-quote&quot;&gt;&quot;username&quot;&lt;/span&gt; VARCHAR2(200))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="13001">DC-1036</key>
            <summary>Doctrine_Export_Oracle::alterTable() not properly quoting column identifier for change</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="johnkary">John Kary</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Sep 2011 16:55:12 +0000</created>
                <updated>Wed, 7 Sep 2011 18:48:09 +0000</updated>
                                    <version>1.2.2</version>
                <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16447" author="johnkary" created="Wed, 7 Sep 2011 18:20:45 +0000"  >&lt;p&gt;Pull request opened with failing test case and bug fix:&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine1/pull/40&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine1/pull/40&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1026] PgSQL driver does not create indexes on foreign key columns</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1026</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Just like in Doctrine 2 (&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DBAL-50):&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DBAL-50):&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The PostgreSQL database does not create indexes for foreign key columns, the user has to create them by hand. I think that indexes for foreign keys should be created automatically&lt;/p&gt;&lt;/blockquote&gt;</description>
                <environment></environment>
            <key id="12907">DC-1026</key>
            <summary>PgSQL driver does not create indexes on foreign key 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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="szjani">Szurovecz J&#225;nos</reporter>
                        <labels>
                    </labels>
                <created>Mon, 8 Aug 2011 11:42:26 +0000</created>
                <updated>Mon, 8 Aug 2011 11:42:26 +0000</updated>
                                    <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1045] data-load with invalid filename leads to purging of all the data in the database</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1045</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Adding an invalid filename to the data-load task results in purging of all the data in the database.&lt;/p&gt;

&lt;p&gt;I am attaching a patch that checks the loaded data if there were any values actually loaded from the fixtures. &lt;/p&gt;</description>
                <environment>symfony 1.4</environment>
            <key id="13241">DC-1045</key>
            <summary>data-load with invalid filename leads to purging of all the data in the database</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="artworx">Keszeg Alexandru</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Dec 2011 16:53:21 +0000</created>
                <updated>Tue, 6 Dec 2011 16:53:21 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="11124" name="diff.patch" size="413" author="artworx" created="Tue, 6 Dec 2011 16:53:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-994] Doctrine_Data_Import creates unnecessary transactions, big slowdown </title>
                <link>http://www.doctrine-project.org/jira/browse/DC-994</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;While trying to load ~25M data fixtures (one big table with relations to 4 smaller ones, sfGuard included in that, row size around 500 bytes) in Symfony i ended up waiting around 80 minutes, while waiting i looked at what could have make it so dreadfully slow. Turns out, when Doctrine_Data_Load gets UnitOfWorks it executes save() on every new record. Save makes it&apos;s own transaction - not a problem if it&apos;s nested, but when this is the main transactions, 70000 of them make quite a difference. Remember - one of the main factors of DBMS speed is transactions/second.&lt;/p&gt;

&lt;p&gt;I patched Doctrine_Data_Import to wrap everything in one transaction, and the results were great - from 80 minutes i got down to around 10. Still, not as fast as it should be but now it&apos;s usable. The time difference is notable also in smaller dumps.&lt;/p&gt;

&lt;p&gt;Patch to speed up loading times included, would be great if you add it to trunk.&lt;/p&gt;

&lt;p&gt;Please note - i have not checked this patch with any other setup or DBMS, please do so. &lt;/p&gt;

&lt;p&gt;Also i have noticed something that might be a problem in much larger loads - if wrapping in a single transaction, my total memory usage went up for about 500M higher than in 70000 transactions. At some point, about 5 minutes in the process some kind of garbage collector fired and freed around 1 gig, so perhaps on larger dumps it might be a good idea to wrap the import not in one, but more transactions (like one transaction every 10000 operations).&lt;/p&gt;</description>
                <environment>MySQL, symfony doctrine:load-data</environment>
            <key id="12537">DC-994</key>
            <summary>Doctrine_Data_Import creates unnecessary transactions, big slowdown </summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="chanibal">Krzysztof Bociurko / ChanibaL</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Apr 2011 14:29:27 +0000</created>
                <updated>Tue, 5 Apr 2011 14:29:27 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10966" name="Doctrine_Data_Import-wrap-in-transaction.patch" size="810" author="chanibal" created="Tue, 5 Apr 2011 14:29:27 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-368] createTablesFromModels() wants to create already existing FOREIGN KEY constraints</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-368</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If you create InnoDB tables from a given model directory, the table generator wants to create a foreign key constraint that already exists.&lt;/p&gt;

&lt;p&gt;1. Doctrine_Core::generateModelsFromYaml(&apos;yaml&apos;, &apos;models&apos;);&lt;br/&gt;
2. Doctrine_Core::createTablesFromModels(&apos;models&apos;);&lt;br/&gt;
3. Running this setup twice, will print out the following error:&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY000&amp;#93;&lt;/span&gt;: General error: 1005 Can&apos;t create table &apos;./dev_mreiche/#sql-930_2cb7.frm&apos; (errno: 121). Failing Query: &quot;ALTER TABLE group_user ADD CONSTRAINT group_user_user_id_user_id FOREIGN KEY (user_id) REFERENCES user(id)&quot;. Failing Query: ALTER TABLE group_user ADD CONSTRAINT group_user_user_id_user_id FOREIGN KEY (user_id) REFERENCES user(id)&lt;/p&gt;</description>
                <environment>mysql  Ver 14.12 Distrib 5.0.75, for debian-linux-gnu (i486) using readline 5.2&lt;br/&gt;
PHP 5.2.11-0.dotdeb.1 with Suhosin-Patch 0.9.7 (cli) (built: Sep 20 2009 09:41:43)&lt;br/&gt;
Ubuntu 9.04&lt;br/&gt;
</environment>
            <key id="10632">DC-368</key>
            <summary>createTablesFromModels() wants to create already existing FOREIGN KEY constraints</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mreiche">Mike Reiche</reporter>
                        <labels>
                    </labels>
                <created>Fri, 18 Dec 2009 13:35:19 +0000</created>
                <updated>Tue, 24 Aug 2010 04:32:21 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="11228" author="mreiche" created="Fri, 18 Dec 2009 13:38:50 +0000"  >&lt;p&gt;Moved model and setup code from description to attachment.&lt;/p&gt;</comment>
                    <comment id="11636" author="m.olszewski" created="Tue, 9 Feb 2010 08:53:02 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Just a quick comment - the test case you&apos;ve provided works fine for me using 1.2.1 and also latest code from 1.2 branch... you might try that.&lt;/p&gt;

&lt;p&gt;The error above (1005) is caused by mismatch between local and foreign key definitions. So it seems somewhere along the lines you/Doctrine messed up field definitions (although I can&apos;t see it provided test case). Try using integer without length definition in YAML, like:&lt;/p&gt;

&lt;p&gt;id:&lt;br/&gt;
      type: integer&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
      primary: true&lt;/p&gt;

&lt;p&gt;and check if this is working.&lt;/p&gt;</comment>
                    <comment id="11886" author="ppw8bnh3jy2a" created="Mon, 1 Mar 2010 14:44:47 +0000"  >&lt;p&gt;I&apos;m having the same issue.  However, I&apos;ve tried the test case using a sqlite memory only database and i can&apos;t trigger the problem.&lt;/p&gt;

&lt;p&gt;Here&apos;s my mysql schema, for your review - which does trigger the issue using 1.2.1.&lt;/p&gt;

</comment>
                    <comment id="11887" author="ppw8bnh3jy2a" created="Mon, 1 Mar 2010 14:48:51 +0000"  >&lt;p&gt;I put some debugging statements in Doctrine/Export.php around line 1216:&lt;br/&gt;
------------&lt;br/&gt;
                      $connection-&amp;gt;exec($query);&lt;br/&gt;
                  } catch (Doctrine_Connection_Exception $e) {&lt;br/&gt;
                      // we only want to silence table already exists errors&lt;br/&gt;
+                     print_r($e-&amp;gt;getPortableCode());&lt;br/&gt;
+                     print_r(Doctrine_Core::ERR_ALREADY_EXISTS);&lt;br/&gt;
+                     print_r($e-&amp;gt;getMessage());&lt;br/&gt;
+                     echo &quot;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&quot;;&lt;br/&gt;
+//                                  exit;&lt;br/&gt;
+&lt;br/&gt;
+                     &lt;br/&gt;
                      if ($e-&amp;gt;getPortableCode() !== Doctrine_Core::ERR_ALREADY_EXISTS) {&lt;br/&gt;
                          $connection-&amp;gt;rollback();&lt;/p&gt;

&lt;p&gt;----------------------&lt;/p&gt;


&lt;p&gt;Here&apos;s the output I get:&lt;/p&gt;

&lt;p&gt;-5-5SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S01&amp;#93;&lt;/span&gt;: Base table or view already exists: 1050 Table &apos;category&apos; already exists. Failing Query: &quot;CREATE TABLE category (id BIGINT AUTO_INCREMENT, name VARCHAR(80), company_id BIGINT, INDEX company_id_idx (company_id), PRIMARY KEY(id)) ENGINE = INNODB&quot;&lt;/p&gt;

&lt;p&gt;-5-5SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S01&amp;#93;&lt;/span&gt;: Base table or view already exists: 1050 Table &apos;company&apos; already exists. Failing Query: &quot;CREATE TABLE company (id BIGINT AUTO_INCREMENT, name VARCHAR(80) UNIQUE, address1 VARCHAR(80), address2 VARCHAR(80), city VARCHAR(80), state VARCHAR(10), zipcode VARCHAR(20), phone VARCHAR(20), fax VARCHAR(20), url VARCHAR(255), logo VARCHAR(255), perferedcolumn BIGINT, randomsort BIGINT, comment LONGTEXT, PRIMARY KEY(id)) ENGINE = INNODB&quot;&lt;/p&gt;

&lt;p&gt;-5-5SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42S01&amp;#93;&lt;/span&gt;: Base table or view already exists: 1050 Table &apos;user&apos; already exists. Failing Query: &quot;CREATE TABLE user (email VARCHAR(255), password VARCHAR(80), fullname VARCHAR(80), company_id BIGINT, cellphone VARCHAR(20), voice VARCHAR(20), voiceext VARCHAR(20), fax VARCHAR(20), comment LONGTEXT, status TINYINT(1), admin TINYINT(1), timeadded DATETIME, timechagned DATETIME, INDEX company_id_idx (company_id), PRIMARY KEY(email)) ENGINE = INNODB&quot;&lt;/p&gt;

&lt;p&gt;-15-5SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;HY000&amp;#93;&lt;/span&gt;: General error: 1005 Can&apos;t create table &apos;./iprfpartners/#sql-7eeb_2d8.frm&apos; (errno: 121). Failing Query: &quot;ALTER TABLE category ADD CONSTRAINT category_company_id_company_id FOREIGN KEY (company_id) REFERENCES company(id)&quot;&lt;/p&gt;

</comment>
                    <comment id="14037" author="aristondarmayuda" created="Mon, 23 Aug 2010 16:12:37 +0000"  >&lt;p&gt;I have same problem, but this problem is face on db engine side. When we look at the last query sql like:&lt;/p&gt;

&lt;p&gt;ALTER TABLE category ADD CONSTRAINT category_company_id_company_id FOREIGN KEY (company_id) REFERENCES company(id)&lt;/p&gt;

&lt;p&gt;The first call of createTablesFromModels will create the table and add contraint which run fine because table and constraint not exist yet. Then when we execute createTablesFromModels again it will fail because it still try to create constraint which already exist on table. I&apos;m still looking on MySql section how to check the constrain if it exist or not. If the constraint not exist then we can execute the sql above, if not we need to avoid execution for sql above, this mean we cannot MODIFY the constrain (like ON UPDATE and ON DELETE mode).&lt;/p&gt;</comment>
                    <comment id="14044" author="aristondarmayuda" created="Tue, 24 Aug 2010 04:29:52 +0000"  >&lt;p&gt;I&apos;ve figure out the errorno: 121 which I thinking is that the process try re-adding existing CONSTRAINT name. The resolve that I&apos;ve found is for MySQL engine and modify some Doctrine libraries.&lt;/p&gt;

&lt;p&gt;1. I&apos;ve modify Doctrine_Export_Mysql by adding override function of:&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;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function createForeignKeySql($table, array $definition)
{
    $tableInfo = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;execute(&apos;SHOW CREATE TABLE &apos;.$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;quoteIdentifier($table));
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($tableInfo &amp;amp;&amp;amp; ($row = $tableInfo-&amp;gt;fetch()))
      &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($row[&apos;Create Table&apos;] &amp;amp;&amp;amp; preg_match(&apos;/CONSTRAINT `&apos;.$definition[&apos;name&apos;].&apos;`.+/i&apos;, $row[&apos;Create Table&apos;])) &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &apos;&apos;;
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; parent::createForeignKeySql($table, $definition);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;2. Since if CONSTRAINT already exist the createForeignKeySql return empty string, we need modify function on Doctrine_Export with:&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;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function createForeignKey($table, array $definition)
{
    $sql = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;createForeignKeySql($table, $definition);
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($sql != &apos;&apos;)
      &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;conn-&amp;gt;execute($sql);
    &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
      &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; -1;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now by add/modify function above I can savely run createTablesFromModels because if CONSTRAINT of a table exist on database the ALTER TABLE ... ADD CONSTRAINT will not generated. Hope this can help some of you guys.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10404" name="schema.txt" size="4059" author="ppw8bnh3jy2a" created="Mon, 1 Mar 2010 14:44:47 +0000" />
                    <attachment id="10239" name="testcase.zip" size="723" author="mreiche" created="Fri, 18 Dec 2009 13:38:50 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-321] Doctrine/Import/Mssql.php does not handle default values</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-321</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If I generate models from sql server I notice that the default values are empty although some columns in the database do have default values.&lt;/p&gt;

&lt;p&gt;I did &apos;EXEC sp_columns @table_name = &apos;page&apos;;&apos; in sql server and I could clearly see default values in &apos;column_def&apos; so somehow the default values get lost.&lt;/p&gt;
</description>
                <environment>using odbc connection to sql server. (SQL Native Client)</environment>
            <key id="10558">DC-321</key>
            <summary>Doctrine/Import/Mssql.php does not handle default values</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="aiso">aiso haikens</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Dec 2009 16:09:00 +0000</created>
                <updated>Thu, 3 Dec 2009 20:16:02 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-689] Columns of type &apos;array&apos; adds default clause to the create table statement which isn&apos;t supported by MySQL.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-689</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The column type &apos;array&apos; creates a column of the type &apos;LONGTEXT&apos; but also adds the default value to the column declaration which makes the creation of the table fail.&lt;/p&gt;

&lt;p&gt;MySQL does not support default values for TEXT, BLOB or LONGTEXT. I don&apos;t know when this behavior was added to MySQL or if it always has been like that. MySQL 5.0.51 will accept it without any SQL mode set, 5.0.83 won&apos;t.&lt;/p&gt;</description>
                <environment>MySQL version 5.0.83, Doctrine 1.2.2, Revision: 7490</environment>
            <key id="11383">DC-689</key>
            <summary>Columns of type &apos;array&apos; adds default clause to the create table statement which isn&apos;t supported by MySQL.</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="daniel">Daniel Holmstrom</reporter>
                        <labels>
                    </labels>
                <created>Tue, 18 May 2010 09:31:17 +0000</created>
                <updated>Fri, 11 Jun 2010 08:31:26 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13163" author="jwage" created="Tue, 8 Jun 2010 11:06:26 +0000"  >&lt;p&gt;Could you provide a test and patch?&lt;/p&gt;</comment>
                    <comment id="13270" author="daniel" created="Fri, 11 Jun 2010 08:29:41 +0000"  >&lt;p&gt;(Un)fortunately I&apos;ll be computer-free for a month now, so I have no time to write test or do a proper patch. I&apos;ll attach the patch I use for reference.&lt;/p&gt;

&lt;p&gt;Since the default clause depends on the native type which isn&apos;t known when the default clause is constructed (in getDefaultFieldDeclaration) I&apos;ve simply added a check that sets the default clause to an empty string if the native type is one of those which isn&apos;t allowed to have a default value. I&apos;m not sure, however, what the line in Doctrine/Export/Mysql.php::276:&lt;/p&gt;

{return $this-&amp;gt;conn-&amp;gt;dataDict-&amp;gt;$method($name, $field);}

&lt;p&gt; does and if that is affected by this also.&lt;/p&gt;

&lt;p&gt;I guess you want the list of native types not allowed to have default values somewhere else, but I don&apos;t have the required knowledge about the internals of Doctrine to do this.&lt;/p&gt;</comment>
                    <comment id="13271" author="daniel" created="Fri, 11 Jun 2010 08:31:26 +0000"  >&lt;p&gt;Attached patch giving example of how to fix &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-689&quot; title=&quot;Columns of type &amp;#39;array&amp;#39; adds default clause to the create table statement which isn&amp;#39;t supported by MySQL.&quot;&gt;DC-689&lt;/a&gt;.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10639" name="DC-689_example_patch.patch.gz" size="477" author="daniel" created="Fri, 11 Jun 2010 08:31:26 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-655] When Export from Models to database is made some constraints may not be created</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-655</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When exporting my schema from yaml I noticed that some CONSTRAINT are not created, but all the models are. After analyzing the code I found that an issue is not related to YAML but is related to Doctrine_Table::getExportableFormat(). I have models creation option to create it in PEAR-like style.&lt;/p&gt;

&lt;p&gt;So, when you have a schema like this:&lt;/p&gt;

&lt;p&gt;----------------&lt;br/&gt;
Partner_Code:&lt;br/&gt;
  tableName: partner_code&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      unsigned: true&lt;br/&gt;
      primary: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
    code:&lt;br/&gt;
      type: string(64)&lt;br/&gt;
      unique: true&lt;br/&gt;
      notnull: true&lt;/p&gt;

&lt;p&gt;Partner_Channel:&lt;br/&gt;
  tableName: partner_channel&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      unsigned: true&lt;br/&gt;
      primary: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
    name:&lt;br/&gt;
      type: string(64)&lt;br/&gt;
      notnull: true&lt;br/&gt;
  relations:&lt;br/&gt;
    Codes:&lt;br/&gt;
      class: Partner_Code&lt;br/&gt;
      local: channel_id&lt;br/&gt;
      foreign: code_id&lt;br/&gt;
      refClass: Partner_Channel_Code&lt;br/&gt;
      foreignAlias: Partner_Channel&lt;br/&gt;
      foreignType: one&lt;br/&gt;
      type: many&lt;/p&gt;

&lt;p&gt;Partner_Channel_Code:&lt;br/&gt;
  tableName: partner_channel_x_code&lt;br/&gt;
  columns:&lt;br/&gt;
    channel_id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      unsigned: true&lt;br/&gt;
      primary: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
    code_id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      unsigned: true&lt;br/&gt;
      primary: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
----------------&lt;/p&gt;

&lt;p&gt;it generates sql like this:&lt;/p&gt;

&lt;p&gt;----------------&lt;br/&gt;
CREATE TABLE partner_channel (id INT UNSIGNED AUTO_INCREMENT, name VARCHAR(64) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = INNODB;&lt;br/&gt;
CREATE TABLE partner_channel_x_code (channel_id INT UNSIGNED, code_id INT UNSIGNED, PRIMARY KEY(channel_id, code_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = INNODB;&lt;br/&gt;
CREATE TABLE partner_code (id INT UNSIGNED AUTO_INCREMENT, code VARCHAR(64) NOT NULL UNIQUE, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = INNODB;&lt;br/&gt;
ALTER TABLE partner_channel_x_code ADD CONSTRAINT partner_channel_x_code_channel_id_partner_channel_id FOREIGN KEY (channel_id) REFERENCES partner_channel(id);&lt;br/&gt;
----------------&lt;/p&gt;

&lt;p&gt;But should also generate:&lt;/p&gt;

&lt;p&gt;----------------&lt;br/&gt;
ALTER TABLE partner_channel_x_code ADD CONSTRAINT partner_channel_x_code_code_id_partner_code_id FOREIGN KEY (code_id) REFERENCES partner_code(id);&lt;br/&gt;
----------------&lt;/p&gt;

&lt;p&gt;But if I just change the schema with this changes (notice the Channel changed to Shannel):&lt;/p&gt;

&lt;p&gt;----------------&lt;br/&gt;
Partner_Channel:&lt;br/&gt;
  relations:&lt;br/&gt;
    Codes:&lt;br/&gt;
      refClass: Partner_Shannel_Code&lt;/p&gt;

&lt;p&gt;Partner_Shannel_Code:&lt;br/&gt;
  tableName: partner_channel_x_code&lt;br/&gt;
----------------&lt;/p&gt;

&lt;p&gt;Everything is created.&lt;/p&gt;

&lt;p&gt;----------------&lt;br/&gt;
CREATE TABLE partner_channel (id INT UNSIGNED AUTO_INCREMENT, name VARCHAR(64) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = INNODB;&lt;br/&gt;
CREATE TABLE partner_code (id INT UNSIGNED AUTO_INCREMENT, code VARCHAR(64) NOT NULL UNIQUE, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = INNODB;&lt;br/&gt;
CREATE TABLE partner_channel_x_code (channel_id INT UNSIGNED, code_id INT UNSIGNED, PRIMARY KEY(channel_id, code_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = INNODB;&lt;br/&gt;
ALTER TABLE partner_channel_x_code ADD CONSTRAINT partner_channel_x_code_code_id_partner_code_id FOREIGN KEY (code_id) REFERENCES partner_code(id);&lt;br/&gt;
ALTER TABLE partner_channel_x_code ADD CONSTRAINT partner_channel_x_code_channel_id_partner_channel_id FOREIGN KEY (channel_id) REFERENCES partner_channel(id);&lt;br/&gt;
----------------&lt;/p&gt;

&lt;p&gt;So as I figured out is that when creating the tables alphabetic order has an influence on creating the CONSTRAINT for that Model in sql. I suppose line 715 of the Doctrine/Table.php near $key = $this-&amp;gt;_checkForeignKeyExists(...) is operating, but I am not sure (when inserting into DB some tables are not created yet?).&lt;/p&gt;

&lt;p&gt;Do not know how to markup here, it&apos;s my first issue in Jira, please press &quot;edit&quot; to see the yaml code formatted &lt;/p&gt;</description>
                <environment>FreeBSD 6.1, Apache 2.2.4, PHP 5.3.2, MySQL 5.0.41</environment>
            <key id="11289">DC-655</key>
            <summary>When Export from Models to database is made some constraints may not be created</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="c0ba">Oleg Stepura</reporter>
                        <labels>
                    </labels>
                <created>Thu, 29 Apr 2010 11:01:05 +0000</created>
                <updated>Fri, 11 Jun 2010 09:05:00 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="12778" author="c0ba" created="Thu, 29 Apr 2010 12:57:26 +0000"  >&lt;p&gt;Also what I noticed today is that this YAML schema:&lt;/p&gt;

&lt;p&gt;Partner_Channel:&lt;br/&gt;
  tableName: partner_channel&lt;br/&gt;
  comment: List of channels.&lt;/p&gt;

&lt;p&gt;Does not add comment to the MySQL table when trying to do this through the cli build-all-load command. Neither the generated Model nor the exported sql chema have this option (&apos;comment&apos;).&lt;/p&gt;

&lt;p&gt;maybe this should be a different bug report...&lt;/p&gt;</comment>
                    <comment id="13272" author="gx" created="Fri, 11 Jun 2010 08:40:46 +0000"  >&lt;p&gt;For your missing table comment, try nesting &quot;comment&quot; into &quot;options&quot;, like this:&lt;/p&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;YAML&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Partner_Channel:
  tableName: partner_channel
  options:
    comment: List of channels.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&amp;#8212;&lt;/p&gt;

&lt;p&gt;Now for the missing constraints issue, I confirm! See #&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-502&quot; title=&quot;sometimes not all the constraints are created for a many to many relation&quot;&gt;DC-502&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13274" author="c0ba" created="Fri, 11 Jun 2010 09:05:00 +0000"  >&lt;p&gt;Hi! As for the comments - your decision seems like a workaround. Is it so or is it the way it should work? Do you know how this kind of stuff will work in 2.0 version?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-615] New sequence generation for PostgreSQL SQL code results in errors</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-615</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;With 1.2.2 we get errors for our generated PostgreSQL code: &quot;sequence &amp;lt;sequence name&amp;gt; already exists&quot;. I tracked down the issue to the following:&lt;/p&gt;

&lt;p&gt;Doctrine_Export_Pgsql::createTableSql() has the following new code:&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;        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($options[&apos;sequenceName&apos;])) {
            $sql[] = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;createSequenceSql($options[&apos;sequenceName&apos;]);
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is fine, but this CREATE SEQUENCE code is now added after the CREATE TABLE code. This does not work okay for PostgreSQL, since PostgreSQL will automatically create the index for you if it does not yet exist. If CREATE SEQUENCE is required for some reason, then it should ge before the CREATE TABLE to be useful (it could for example be useful if different increment intervals or starting numbers should be set for the sequence).&lt;/p&gt;

&lt;p&gt;I tried moving the new code up, but that did not yet give me the desired results. The issue is that Doctrine_Export::exportClassesSql() collects all the SQL in an array and finally does:&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;rsort($sql);
&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $sql;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This can break any statement set in there that should be run in a specific order. For the PostgreSQL code, this will put all the CREATE TABLE calls in font of the CREATE SEQUENCE calls, resulting in the errors that we see.&lt;/p&gt;

&lt;p&gt;Suggested fix options:&lt;/p&gt;

&lt;p&gt;1) Do not sort the SQL queries, but accept them as generated by the db specific Export class (but I&apos;m only suggesting this, because I am not aware of the reason to do an rsort() in the first place).&lt;/p&gt;

&lt;p&gt;2) Change the PostgreSQL export code to make it immune to the sorting.&lt;/p&gt;

&lt;p&gt;We did the latter in our code. The CREATE SEQUENCE and CREATE TABLE are concatenated into one statement string (&quot;&amp;lt;squence&amp;gt;;&amp;lt;table&amp;gt;&quot;) that is added to the list of SQL queries. This provides us a work-around for the problem. The first solution is more clean IMO, but I lack knowledge to tell if the rsort() is here for technical or aesthetic reasons. &lt;/p&gt;</description>
                <environment></environment>
            <key id="11168">DC-615</key>
            <summary>New sequence generation for PostgreSQL SQL code results in errors</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mmakaay">Maurice Makaay</reporter>
                        <labels>
                    </labels>
                <created>Fri, 2 Apr 2010 16:53:14 +0000</created>
                <updated>Sat, 22 Jan 2011 08:41:30 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14251" author="mmakaay" created="Fri, 3 Sep 2010 06:10:48 +0000"  >&lt;p&gt;An additional issue for the PostgreSQL sequence handling: the Doctrine code does create a sequence field in the tables. However, the sequence system seems not to be in use at all for generating new id fields. As a result, the sequences remain at their initial value of 1.&lt;/p&gt;

&lt;p&gt;We noticed this when we tried to manually insert a record in the database. Five records were already available. The manual INSERT failed, because of a duplicate index error on the id field. After a few attempts, it did work. That was because the PostgreSQL sequence had reached a value of 6, which was a non-existing id for the table at that point.&lt;/p&gt;

&lt;p&gt;I think that a choice has to be made here: either use sequences or don&apos;t:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;When id&apos;s are always generated without using the sequence features of PostgreSQL, then do not create the id fields as sequences, but make them standard primary key integer fields instead, so no unused sequence objects will be created in the database.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;When id generation makes use of sequence features, then it&apos;s okay to use sequences for id fields. When doing this, loading a new dataset into the database might require some additional attention for the sequences. After import, the sequences should be updated to represent the first free id value for the table that it is providing id values for. When data import makes use of the sequences directly for generating id&apos;s, then this would not be necessary of course.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I hope this helps in improving Doctrine.&lt;/p&gt;</comment>
                    <comment id="15158" author="mmakaay" created="Sat, 22 Jan 2011 08:41:30 +0000"  >&lt;p&gt;The issue with the duplicate id&apos;s is fixed on our system.&lt;/p&gt;

&lt;p&gt;When defining &quot;sequence: &amp;lt;something&amp;gt;&quot; in a YAML file for a field, Doctrine will generate two sequences: one as specified in the YAML data and one as autogenerated by PostgreSQL. Doctrine inserts will use one, direct inserts via SQL will use the other. By specifying an field as primary and autoincrement, a correct and single sequence will be generated.&lt;/p&gt;

&lt;p&gt;This work-around works for us. The Doctrine team will have to decide on what the expected behavior for &quot;sequence&quot; is. The current workings seem a bit off IMO.&lt;/p&gt;

&lt;p&gt;I hope this helps. Thanks.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10541" name="PostreSQL.createTableSql.sequence.fix.diff" size="1685" author="mmakaay" created="Fri, 2 Apr 2010 16:53:14 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-502] sometimes not all the constraints are created for a many to many relation</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-502</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;it seems that the naming is important:&lt;/p&gt;

&lt;p&gt;in a User, Group, UserGroup relation (where the UserGroup defines the many to many relation for User &amp;amp; Group) the constraints are defined well&lt;/p&gt;

&lt;p&gt;but if the tables are Order, Service, OrderService it doesn&apos;t work =&amp;gt; just one constraint is created... please find my example:&lt;/p&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;schema.yml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;Order:
  tableName:          orders
  columns:
    name:             string(50)
  relations:
    Services:
      class:          Service
      local:          order_id
      foreign:        service_id
      refClass:       OrderService

Service:
  actAs:
    Versionable:      ~
  columns:
    name:             string(50)
  relations:
    Orders:
      class:          Order
      local:          service_id
      foreign:        order_id
      refClass:       OrderService

# WTF: it takes alphbetically the constraints building  !?
# &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; I used ZorderService instead of OrderService, Z is after S (O is before S) the constraints are defined fine!
OrderService:
  columns:
    order_id:         { type: integer, primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
    service_id:       { type: integer, primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt; ==&amp;gt; the generated SQL &lt;/p&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;sql&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;CREATE TABLE orders (id BIGINT AUTO_INCREMENT, name VARCHAR(50), PRIMARY KEY(id)) ENGINE = INNODB;
CREATE TABLE order_service (order_id BIGINT, service_id BIGINT, version BIGINT, PRIMARY KEY(order_id, service_id, 
        version)) ENGINE = INNODB;
CREATE TABLE service_version (id BIGINT, name VARCHAR(50), version BIGINT, PRIMARY KEY(id, version)) ENGINE = 
        INNODB;
CREATE TABLE service (id BIGINT AUTO_INCREMENT, name VARCHAR(50), version BIGINT, PRIMARY KEY(id)) ENGINE = 
        INNODB;
ALTER TABLE order_service ADD CONSTRAINT order_service_order_id_orders_id FOREIGN KEY (order_id) REFERENCES 
        orders(id);
ALTER TABLE service_version ADD CONSTRAINT service_version_id_service_id FOREIGN KEY (id) REFERENCES service(id) 
        ON UPDATE CASCADE ON DELETE CASCADE;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;=&amp;gt;  as you can see for TABLE order_service just one constraint is defined (&lt;b&gt;order_service_order_id_orders_id&lt;/b&gt;) the other one (&lt;b&gt;order_service_service_id_service_id&lt;/b&gt;) is missing !!!&lt;/p&gt;


&lt;p&gt;However if i change the names for tables (actually i think alphabetically order) and use ZorderService instead of OrderService (lik UserGroup for User &amp;amp; Group) the two constraints are created!&lt;/p&gt;

&lt;p&gt;This also affects the &quot;getRelations()&quot; when i tried to write a behavior (it gives back just one relation):&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;  foreach ($event-&amp;gt;getInvoker()-&amp;gt;getTable()-&amp;gt;getRelations() as $relation)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;ps: &lt;br/&gt;
  also the same bug reported on the list: &lt;a href=&quot;http://groups.google.com/group/doctrine-user/browse_thread/thread/ad48db71b71e043b&quot; class=&quot;external-link&quot;&gt;http://groups.google.com/group/doctrine-user/browse_thread/thread/ad48db71b71e043b&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;sub&gt;(edit G.X: split too long lines in SQL code)&lt;/sub&gt;&lt;/p&gt;</description>
                <environment>i tried both under linux / win; with doctrine 1.1 / 1.2.1&lt;br/&gt;
tried with sandbox / direct creating &amp;quot;bootstrap&amp;quot; =&amp;gt; same results...</environment>
            <key id="10899">DC-502</key>
            <summary>sometimes not all the constraints are created for a many to many relation</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="rich">Papp Richard</reporter>
                        <labels>
                    </labels>
                <created>Mon, 15 Feb 2010 15:18:01 +0000</created>
                <updated>Mon, 14 Jun 2010 03:38:30 +0000</updated>
                                    <version>1.2.0-ALPHA1</version>
                <version>1.2.0-ALPHA2</version>
                <version>1.2.0-ALPHA3</version>
                <version>1.2.0-BETA1</version>
                <version>1.2.0-BETA2</version>
                <version>1.2.0-BETA3</version>
                <version>1.2.0-RC1</version>
                <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                                                <component>Import/Export</component>
                <component>Relations</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12720" author="ryba" created="Tue, 20 Apr 2010 14:36:59 +0000"  >&lt;p&gt;I seem to have a very similar issue. It is really annoying because no error feedback is given at any point...&lt;br/&gt;
In my case, one out of three many-to-many relations actually has its constraints created, the other two not.&lt;br/&gt;
However, if I take the file date/sql/schema.sql (I am working with Symfony 1.4.4) and run as an SQL query directly with my database, the constraints are created properly!&lt;/p&gt;

&lt;p&gt;So, with symfony, if I go:&lt;br/&gt;
$ symfony14 doctrine:build-model&lt;br/&gt;
$ symfony14 doctrine:build-sql&lt;br/&gt;
$ symfony14 doctrine:insert-sql&lt;br/&gt;
The model gets generated, the database gets generated, but several many-to-many constrains are missing.&lt;/p&gt;

&lt;p&gt;Then if I go:&lt;br/&gt;
$ symfony14 doctrine:build-model&lt;br/&gt;
$ symfony14 doctrine:build-sql&lt;br/&gt;
$ mysql -u user -p database &amp;lt; date/sql/schema.sql&lt;br/&gt;
The model gets generated, the database gets generated, and the constraints are in place.&lt;/p&gt;

&lt;p&gt;Hope this helps to have the problem fixed.&lt;/p&gt;

&lt;p&gt;Cheers,&lt;br/&gt;
Piotrek&lt;/p&gt;</comment>
                    <comment id="13273" author="gx" created="Fri, 11 Jun 2010 08:47:19 +0000"  >&lt;p&gt;I do confirm this &quot;alphabetical-order exporting&quot; problem! (in 1.2 svn revision 7676)&lt;br/&gt;
(see also #&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-655&quot; title=&quot;When Export from Models to database is made some constraints may not be created&quot;&gt;DC-655&lt;/a&gt;)&lt;/p&gt;


&lt;p&gt;*&lt;b&gt;Edit:&lt;/b&gt;* I have gone closer through the functions calls and used a debugger, and the problem is actually logical;&lt;br/&gt;
it happens whenever a refClass of a many-to-many relation is parsed (and exported) before one or both of the linked classes.&lt;/p&gt;

&lt;p&gt;Let&apos;s take this schema (YAML is shorter, anyways the generated PHP models are not bugged):&lt;/p&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;schema.yml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-none&quot;&gt;---
LinkTable:
  columns:
    table1_id:
      primary: true
      type:    integer
    table2_id:
      primary: true
      type:    integer
Table1:
  relations:
    Table2:
      refClass: LinkTable
      local:    table1_id
      foreign:  table2_id
Table2:
  relations:
    Table1:
      refClass: LinkTable
      local:    table2_id
      foreign:  table1_id
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now if you call Doctrine_Core::createTablesFromModels() or Doctrine_Core::generateSqlFromModels(), consequent call to Doctrine_Export::exportSortedClassesSql() does a loop and calls exportClassesSql() for each model in alphabetical order; once a table has been exported, subsequent bindings of pending relations won&apos;t be &quot;retro-parsed&quot; for the export.&lt;/p&gt;

&lt;p&gt;I tried to compact the calls chain:&lt;/p&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;php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/* IN CLASS Doctrine_Export (or child (connection export)) */

$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;exportSortedClassesSql($classes)
{
    FOREACH ($classes as $class) {
        $connection = Doctrine_Manager::getInstance()-&amp;gt;getConnectionForComponent($class);
        &lt;span class=&quot;code-comment&quot;&gt;//...
&lt;/span&gt;        $sql =
        $connection-&amp;gt;export-&amp;gt;exportClassesSql($models = array($class))
        {
            FOREACH ($models as $name) {
                $record = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; $name();
                $table = $record-&amp;gt;getTable();
                &lt;span class=&quot;code-comment&quot;&gt;//...
&lt;/span&gt;                $data = $table-&amp;gt;getExportableFormat()
                {
                    /* IN CLASS Doctrine_Table (or child) */
                    
                    &lt;span class=&quot;code-comment&quot;&gt;//...
&lt;/span&gt;                    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_parser-&amp;gt;getRelations()
                    {
                        /* IN CLASS Doctrine_Relation_Parser (or child) */
                        
                        FOREACH ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_pending as $alias =&amp;gt; $v) {
                            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;getRelation($alias)
                            {
                                &lt;span class=&quot;code-comment&quot;&gt;//...
&lt;/span&gt;                                /*
                                 * In the &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; of an &lt;span class=&quot;code-quote&quot;&gt;&quot;association relation&quot;&lt;/span&gt; through a refTable:
                                 *   binds a *pending* (simple foreign key) relation to the refTable parser,
                                 *   binds a *pending* (simple foreign key) relation to itself,
                                 *   and &lt;span class=&quot;code-quote&quot;&gt;&quot;finalizes&quot;&lt;/span&gt; (adds to $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_relations) its association relation
                                 */
                            }
                        }
                    }
                    &lt;span class=&quot;code-comment&quot;&gt;//...
&lt;/span&gt;                }
            }
        }
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;So, with our example schema,&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;LinkTable is exported with &lt;b&gt;no&lt;/b&gt; constraints (because has no relations at this time);&lt;/li&gt;
	&lt;li&gt;Table1 gets parsed, which finalizes the pending relation with Table2 (binded when loaded), binds to itself a pending relation with LinkTable, and binds to LinkTable parser the first &lt;b&gt;pending&lt;/b&gt; relation (with Table1); Table1 is then exported whilst it still has a pending relation;&lt;/li&gt;
	&lt;li&gt;Table2 gets parsed and exported the same way.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;So now we have 2 problems:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;each table has been exported immediately after its parsing, i.e. in an &lt;em&gt;incomplete state&lt;/em&gt; (&lt;b&gt;this is the present issue&lt;/b&gt;)&lt;/li&gt;
	&lt;li&gt;even after the whole relations parsing loop, LinkTable has still &lt;em&gt;2 pending relations&lt;/em&gt;, and each of both other tables has one &quot;final&quot; &lt;em&gt;and one pending&lt;/em&gt; (but maybe it is supposed to be so...)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Note that a second call to Doctrine_Core::generateSqlFromModels() just after the first one, will parse all models one more time and thus finalize those pending relations, generating all constraints (also will subsequent calls).&lt;/p&gt;


&lt;p&gt;For now I don&apos;t have a fix but I think we could consider:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;loop twice in Doctrine_Export::exportSortedClassesSql() and exportClassesSql(), and construct SQL queries only the 2nd time (but... hum...)&lt;/li&gt;
	&lt;li&gt;improve Doctrine_Relation_Parser? maybe explicitly call getRelations() after each bind() (in the getRelation() function)...&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Anyway it seems clear that export shouldn&apos;t be done before all tables have been parsed.&lt;/p&gt;

&lt;p&gt;G.X&lt;/p&gt;</comment>
                    <comment id="13283" author="gx" created="Sat, 12 Jun 2010 16:17:25 +0000"  >&lt;p&gt;I still have no fix but in the waiting we can still discuss some &quot;user-side&quot; work-arounds (that don&apos;t need modifying Doctrine source code)...&lt;br/&gt;
Here is what crosses my mind first:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;(in the PHP working code) do a first &quot;dummy&quot; call to 
&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;$conn-&amp;gt;export-&amp;gt;exportClassesSql(Doctrine_Core::loadModels(&apos;models&apos;))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; just to ensure all relations are bound, then a &quot;real&quot; call to  &lt;tt&gt;Doctrine_Core::createTablesFromModels(&apos;models&apos;)&lt;/tt&gt; which will export all constraints well&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;(in the schema) rename &lt;em&gt;LinkTable&lt;/em&gt; to something like &lt;em&gt;ZzLinkTable&lt;/em&gt; so that it is exported last&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&quot;explicitize&quot; the two (one-to-many) foreign key relations in LinkTable by completing the schema as follows:
&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;schema.yml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-none&quot;&gt;---
LinkTable:
  columns:
    table1_id:
      primary: true
      type:    integer
    table2_id:
      primary: true
      type:    integer
#(added)
  relations:
    Table1:
      local:   table1_id
      foreign: id
    Table2:
      local:   table2_id
      foreign: id
#(/added)
Table1:
  relations:
    Table2:
      refClass: LinkTable
      local:    table1_id
      foreign:  table2_id
Table2:
  relations:
    Table1:
      refClass: LinkTable
      local:    table2_id
      foreign:  table1_id
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;(&lt;em&gt;I think this one would also &quot;solve&quot; the behavior problem of Papp Richard&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;But I&apos;m not that happy with the idea of choosing one of these &quot;hacks&quot; &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; if I had to, I would use this last one but (unless you use some &quot;&lt;tt&gt;onDelete: CASCADE&lt;/tt&gt;&quot; or so) it looks like unnecessary duplication...&lt;br/&gt;
Someone, any other idea? ^^&lt;/p&gt;

&lt;p&gt;G.X&lt;/p&gt;

&lt;p&gt;(edit: typo fix)&lt;/p&gt;</comment>
                    <comment id="13292" author="gx" created="Sun, 13 Jun 2010 08:00:34 +0000"  >&lt;p&gt;We can try another approach too: let&apos;s say that our generated PHP models classes &lt;b&gt;are&lt;/b&gt; incomplete.&lt;/p&gt;

&lt;p&gt;Indeed, for a simple foreign key relation (i.e. o2o and o2m / m2o), we can define it only once on the owning side in the YAML file, and the schema importer will generate complete PHP classes, with the &quot;hasOne&quot; on the owning side &lt;b&gt;and&lt;/b&gt; the auto-completed &quot;hasMany&quot; on the opposite side. E.g:&lt;/p&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;YAML schema&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-none&quot;&gt;Phonenumber:
  columns:
    user_id: integer
  relations:
    User: {local: user_id, foreign: id}
User:
# we don&apos;t precise the opposite relation here
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;will generate the following classes (simplified a bit):&lt;/p&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;PHP models (1)&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;// models/Phonenumber.php
&lt;/span&gt;class Phonenumber &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition() {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;user_id&apos;, &apos;integer&apos;);
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp() {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;User&apos;, array(&apos;local&apos;   =&amp;gt; &apos;user_id&apos;,
                                    &apos;foreign&apos; =&amp;gt; &apos;id&apos;));
    }
}

&lt;span class=&quot;code-comment&quot;&gt;// models/User.php
&lt;/span&gt;class User &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition() {
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp() {
        &lt;span class=&quot;code-comment&quot;&gt;// &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; was auto-added during the schema &lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt;:
&lt;/span&gt;        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Phonenumber&apos;, array(&apos;local&apos;   =&amp;gt; &apos;id&apos;,
                                            &apos;foreign&apos; =&amp;gt; &apos;user_id&apos;));
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and this will work well.&lt;br/&gt;
BUT, now if we &lt;em&gt;remove the auto-added hasMany()&lt;/em&gt; in User.php, then run the following (which worked well before our manual modification):&lt;/p&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;test.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;require_once &apos;bootstrap.php&apos;;

$user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
Doctrine_Core::dump($user-&amp;gt;Phonenumber);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;we get some &lt;tt&gt;Fatal error: Uncaught exception &apos;Doctrine_Record_UnknownPropertyException&apos; with message &apos;Unknown record property / related component &quot;Phonenumber&quot; on &quot;User&quot;&apos;&lt;/tt&gt;, which is supposed to occur. Indeed, how could Doctrine know that a User has a &quot;link&quot; with Phonenumber? It would be only possible by parsing the relations of all the (loaded) models first...&lt;/p&gt;

&lt;p&gt;So we can say that &lt;em&gt;YAML schema files can be incomplete &lt;b&gt;whereas&lt;/b&gt; PHP models classes MUST be COMPLETE.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now, considering it is not to change, why not apply this &quot;principle&quot; to (m2m) association relations?&lt;br/&gt;
i.e., &lt;b&gt;Doctrine documentation could warn&lt;/b&gt; that, if you want to have all constraints properly exported (like in the present issue) and/or use relations from an association class (having &lt;tt&gt;$link&lt;/tt&gt; instance of &lt;tt&gt;LinkTable&lt;/tt&gt;, you want to use &lt;tt&gt;$link-&amp;gt;Table1&lt;/tt&gt;, not just &lt;tt&gt;$link-&amp;gt;table1_id&lt;/tt&gt;), then you MUST complete your PHP models with the FK relations, like this:&lt;/p&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;PHP models (2)&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;// models/LinkTable.php
&lt;/span&gt;class LinkTable &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition() {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;table1_id&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(
                &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;table2_id&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(
                &apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp() {
        &lt;span class=&quot;code-comment&quot;&gt;// ADD:
&lt;/span&gt;        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;Table1&apos;, array(&apos;local&apos;   =&amp;gt; &apos;table1_id&apos;,
                                      &apos;foreign&apos; =&amp;gt; &apos;id&apos;));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;Table2&apos;, array(&apos;local&apos;   =&amp;gt; &apos;table2_id&apos;,
                                      &apos;foreign&apos; =&amp;gt; &apos;id&apos;));
    }
}

&lt;span class=&quot;code-comment&quot;&gt;// models/Table1.php
&lt;/span&gt;class Table1 &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition() {
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp() {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Table2&apos;, array(&apos;refClass&apos; =&amp;gt; &apos;LinkTable&apos;,
                                       &apos;local&apos;    =&amp;gt; &apos;table1_id&apos;,
                                       &apos;foreign&apos;  =&amp;gt; &apos;table2_id&apos;));
        &lt;span class=&quot;code-comment&quot;&gt;// add too?:
&lt;/span&gt;        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;LinkTable&apos;, array(&apos;local&apos;    =&amp;gt; &apos;id&apos;,
                                          &apos;foreign&apos;  =&amp;gt; &apos;table1_id&apos;));
    }
}

&lt;span class=&quot;code-comment&quot;&gt;// models/Table2.php
&lt;/span&gt;class Table2 &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition() {
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp() {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Table1&apos;, array(&apos;refClass&apos; =&amp;gt; &apos;LinkTable&apos;,
                                       &apos;local&apos;    =&amp;gt; &apos;table2_id&apos;,
                                       &apos;foreign&apos;  =&amp;gt; &apos;table1_id&apos;));
        &lt;span class=&quot;code-comment&quot;&gt;// add too?:
&lt;/span&gt;        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;LinkTable&apos;, array(&apos;local&apos;    =&amp;gt; &apos;id&apos;,
                                          &apos;foreign&apos;  =&amp;gt; &apos;table2_id&apos;));
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;After all, these additional relations are bound internally (if not already defined) when exporting tables to DB...&lt;/p&gt;

&lt;p&gt;We also said that the YAML can be incomplete, but for now the short schema.yml I took as an example in my first comment results in PHP classes &lt;em&gt;without&lt;/em&gt; those (2+1+1) adds.&lt;/p&gt;

&lt;p&gt;So to allow YAML to be incomplete even for m2m relations, &lt;em&gt;Doctrine_Import_Schema#_buildRelationships()&lt;/em&gt; would need some &quot;improvement&quot; so that it creates the many-to-one relation for each many-to-many relation (and the opposite one-to-many relation, on the association class side i.e. the owning side, would be auto-completed afterwards). However, a m2m relation is allowed to be defined on one single end, thus may be created one the other end only when _&lt;em&gt;autoCompleteOppositeRelations()&lt;/em&gt; is called, i.e. after _&lt;em&gt;buildRelationships()&lt;/em&gt; has looped over all the existing relations. So &lt;em&gt;Doctrine_Import_Schema#_autoCompleteOppositeRelations()&lt;/em&gt; would need the same kind of improvement...&lt;/p&gt;

&lt;p&gt;In fact I&apos;m not sure of what is a &quot;well defined&quot; model as soon as it uses refClass, the documentation sometimes uses contradictory examples...&lt;/p&gt;

&lt;p&gt;Sorry I was so verbose!&lt;br/&gt;
Thank you for developing Doctrine &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-473] createIndexSql() and dropIndexSql() use different index names (formatter) on MySQL and Postgres</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-473</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;While playing with createIndexSql() and dropIndexSql() i noticed, that the pgsql implementation differs from mysql. The index names usually are build with a &apos;_idx&apos; after the name. This is done through the formatter, i guess.&lt;/p&gt;

&lt;p&gt;I noticed, that in Doctrine_Export class the createIndexSql() method does not use the formatter, while dropIndexSql() do. So creating and dropping indexes on pgsql (in my case) fails because of the different names. It does work on mysql, because Doctrine_Export_Mysql class uses it&apos;s own createIndexSql() method where the formatter is used.&lt;/p&gt;

&lt;p&gt;Michael&lt;/p&gt;</description>
                <environment>Postgres 8.3, MySQL 5.0</environment>
            <key id="10825">DC-473</key>
            <summary>createIndexSql() and dropIndexSql() use different index names (formatter) on MySQL and Postgres</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="michael.piecko">Michael Piecko</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Feb 2010 11:34:56 +0000</created>
                <updated>Tue, 8 Jun 2010 17:04:37 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12256" author="jwage" created="Mon, 15 Mar 2010 17:47:46 +0000"  >&lt;p&gt;Hi, can you provide either a patch or failing test case that shows the issue so that I can write a patch for it? Thanks, Jon&lt;/p&gt;</comment>
                    <comment id="12314" author="michael.piecko" created="Thu, 18 Mar 2010 03:44:00 +0000"  >&lt;p&gt;I must admit that i never did that (patch). And i know i should. I&apos;ll work on that over the weekend.&lt;/p&gt;

&lt;p&gt;Michael&lt;/p&gt;</comment>
                    <comment id="13218" author="jwage" created="Tue, 8 Jun 2010 17:04:37 +0000"  >&lt;p&gt;You can just make your changes and then run svn diff in the Doctrine directory and it will produce a patch/diff which you can attach here.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-831] Importing fixtures fails when GoogleI18n used with &quot;Couldn&apos;t create collection index. Record field &apos;lang&apos; was null.&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-831</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;There&apos;s a problem with Doctrine_Data_Import. When trying to load a fixture record with translations, and GoogleI18n (or similar) instead of I18n is used (via actAs()), the following crash happens:&lt;br/&gt;
Couldn&apos;t create collection index. Record field &apos;lang&apos; was null.&lt;/p&gt;

&lt;p&gt;#0 /Users/argasek/Sites/fwm/library/doctrine/Doctrine/Access.php(131): Doctrine_Collection-&amp;gt;add(Object(Fwm_Shop_Catalog_CategoryTranslation))&lt;br/&gt;
#1 /Users/argasek/Sites/test/library/doctrine/Doctrine/Data/Import.php(241): Doctrine_Access-&amp;gt;offsetSet(NULL, Object(Test_Shop_Catalog_CategoryTranslation))&lt;br/&gt;
#2 /Users/argasek/Sites/test/library/doctrine/Doctrine/Data/Import.php(335): Doctrine_Data_Import-&amp;gt;_processRow(&apos;(catalog_catego...&apos;, Array)&lt;br/&gt;
#3 /Users/argasek/Sites/test/library/doctrine/Doctrine/Data/Import.php(118): Doctrine_Data_Import-&amp;gt;_loadData(Array)&lt;br/&gt;
#4 /Users/argasek/Sites/test/library/doctrine/Doctrine/Data.php(222): Doctrine_Data_Import-&amp;gt;doImport(false)&lt;br/&gt;
#5 /Users/argasek/Sites/test/library/doctrine/Doctrine/Core.php(1011): Doctrine_Data-&amp;gt;importData(&apos;/Users/argasek/...&apos;, &apos;yml&apos;, Array, false)&lt;br/&gt;
#6 /Users/argasek/Sites/test/library/doctrine/Doctrine/Task/LoadData.php(43): Doctrine_Core::loadData(&apos;/Users/argasek/...&apos;, false)&lt;br/&gt;
#7 /Users/argasek/Sites/test/library/doctrine/Doctrine/Cli.php(516): Doctrine_Task_LoadData-&amp;gt;execute()&lt;br/&gt;
#8 /Users/argasek/Sites/test/library/doctrine/Doctrine/Cli.php(498): Doctrine_Cli-&amp;gt;executeTask(Object(Doctrine_Task_LoadData), Array)&lt;br/&gt;
#9 /Users/argasek/Sites/test/library/doctrine/Doctrine/Cli.php(452): Doctrine_Cli-&amp;gt;_run(Array)&lt;br/&gt;
#10 /Users/argasek/Sites/test/scripts/doctrine-cli.php(29): Doctrine_Cli-&amp;gt;run(Array)&lt;br/&gt;
#11 &lt;/p&gt;
{main}

&lt;p&gt;I have narrowed down the problem to the line 135 of Doctrine/Data/Import.php, ie.&lt;/p&gt;

&lt;p&gt;if ($table-&amp;gt;hasRelation($key) &amp;amp;&amp;amp; is_array($value) &amp;amp;&amp;amp; ! $table-&amp;gt;hasTemplate(&apos;Doctrine_Template_I18n&apos;)) {&lt;/p&gt;

&lt;p&gt;In case of GoogleI18n, $table-&amp;gt;hasTemplate(&apos;Doctrine_Template_I18n&apos;) returns false.&lt;/p&gt;

&lt;p&gt;I have no idea how to patch this in a sane way. Adding another condition (&amp;amp;&amp;amp; ! $table-&amp;gt;hasTemplate(&apos;Doctrine_Template_GoogleI18n&apos;) serves well as a workaround, but such condition would be required for any class similar to Doctrine_Template_GoogleI18n. I guess the condition should check if it&apos;s a Doctrine_Template_I18n template or any template iherited from this class?...&lt;/p&gt;</description>
                <environment>Mac OS X 10.6.4, Zend Server CE 5.0.2 (irrelevant, I guess)</environment>
            <key id="11784">DC-831</key>
            <summary>Importing fixtures fails when GoogleI18n used with &quot;Couldn&apos;t create collection index. Record field &apos;lang&apos; was null.&quot;</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="argasek">Jakub Argasi&#324;ski</reporter>
                        <labels>
                    </labels>
                <created>Tue, 17 Aug 2010 06:55:40 +0000</created>
                <updated>Wed, 13 Oct 2010 08:02:30 +0000</updated>
                                    <version>1.2.2</version>
                <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Data Fixtures</component>
                <component>I18n</component>
                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13975" author="argasek" created="Tue, 17 Aug 2010 07:40:42 +0000"  >&lt;p&gt;I have provided a quick workaround patch for this problem, with an approach described in my report, ie. checking whether table has a template being an instance of or a child of Doctrine_Template_I18n.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10743" name="fix_google18n_and_similiar_import_problem.patch" size="1387" author="argasek" created="Tue, 17 Aug 2010 07:40:42 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-798] Change column Postgres</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-798</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Migration_Base::changeColumn doesn&apos;t change the DB column when using Postgres. &lt;/p&gt;

&lt;p&gt;In Doctrine_Export_Pgsql::alterTableSql it checks for an index &apos;type&apos; in the $field array, but the &apos;type&apos; index is in $field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;definition&amp;#39;&amp;#93;&lt;/span&gt;, so we never enter there. Furthermore it then tries to get the type declaration with $this-&amp;gt;conn-&amp;gt;datatype-&amp;gt;getTypeDeclaration($field&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;definition&amp;#39;&amp;#93;&lt;/span&gt;) but there is no datatype property on the collection.&lt;br/&gt;
The attached patch should fix these problems.&lt;/p&gt;</description>
                <environment>Mac OS X 10.6, doctrine 1.2, symfony 1.4, postgres 8.4</environment>
            <key id="11684">DC-798</key>
            <summary>Change column Postgres</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lea">Lea Haensenberger</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Jul 2010 08:33:25 +0000</created>
                <updated>Thu, 19 Aug 2010 10:10:07 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13712" author="lsmith" created="Tue, 27 Jul 2010 10:31:56 +0000"  >&lt;p&gt;hmm .. seems like a refactoring issue with the old MDB2 code. same issue could be in other places too.&lt;/p&gt;</comment>
                    <comment id="13999" author="lsmith" created="Wed, 18 Aug 2010 08:30:05 +0000"  >&lt;p&gt;may i commit the patch?&lt;/p&gt;</comment>
                    <comment id="14000" author="jwage" created="Wed, 18 Aug 2010 11:30:43 +0000"  >&lt;p&gt;Do the other drivers reference the &apos;definition&apos; too?&lt;/p&gt;</comment>
                    <comment id="14001" author="jwage" created="Wed, 18 Aug 2010 11:33:46 +0000"  >&lt;p&gt;The other classes don&apos;t seem to reference the &apos;definition&apos;. It looks like the information is right in the root of the array, why is it different in this case?&lt;/p&gt;</comment>
                    <comment id="14016" author="lsmith" created="Thu, 19 Aug 2010 10:10:07 +0000"  >&lt;p&gt;ok the patch has been committed.&lt;/p&gt;

&lt;p&gt;the others do also reference &apos;definition&apos;, its just that for mysql and sqlite the code is simpler because there you can just give a new definition, in postgresql you need to explicitly pass what you want to change and therefore the code needs to work differently.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10710" name="doctrine.patch" size="2227" author="lea" created="Tue, 27 Jul 2010 08:33:25 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-793] import-&gt;listTableColumns / export-&gt;alterTableSql issues</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-793</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I am not sure where to lay the blame for the following issue.  I am using import-&amp;gt;listTableColumns() to get the metadata of existing tables.  I am then changing the name of the the columns in the tables retrieved using export-&amp;gt;alterTable()... in general this seems to be working perfectly ok except for MYSQL LONGTEXT type fields.  listTableColumns is returning the following schema:&lt;/p&gt;

&lt;p&gt;  &apos;pn_value&apos; =&amp;gt; &lt;br/&gt;
    array&lt;br/&gt;
      &apos;name&apos; =&amp;gt; string &apos;pn_value&apos; (length=8)&lt;br/&gt;
      &apos;type&apos; =&amp;gt; string &apos;string&apos; (length=6)&lt;br/&gt;
      &apos;alltypes&apos; =&amp;gt; &lt;br/&gt;
        array&lt;br/&gt;
          0 =&amp;gt; string &apos;string&apos; (length=6)&lt;br/&gt;
          1 =&amp;gt; string &apos;clob&apos; (length=4)&lt;br/&gt;
      &apos;ntype&apos; =&amp;gt; string &apos;longtext&apos; (length=8)&lt;br/&gt;
      &apos;length&apos; =&amp;gt; null&lt;br/&gt;
      &apos;fixed&apos; =&amp;gt; boolean false&lt;br/&gt;
      &apos;unsigned&apos; =&amp;gt; boolean false&lt;br/&gt;
      &apos;values&apos; =&amp;gt; &lt;br/&gt;
        array&lt;br/&gt;
          empty&lt;br/&gt;
      &apos;primary&apos; =&amp;gt; boolean false&lt;br/&gt;
      &apos;default&apos; =&amp;gt; null&lt;br/&gt;
      &apos;notnull&apos; =&amp;gt; boolean false&lt;br/&gt;
      &apos;autoincrement&apos; =&amp;gt; boolean false&lt;/p&gt;

&lt;p&gt;And when I send this to export-&amp;gt;alterTable() it&apos;s generating the following SQL&lt;br/&gt;
ALTER TABLE z_module_vars CHANGE pn_value z_value VARCHAR(255)&lt;/p&gt;

&lt;p&gt;So you can see it&apos;s truncating the field.  The schema returned from the import of column definitions seems strange since there are two alltypes - and I wonder if that is why alterTables just assumes a string of 255 characters?&lt;/p&gt;

&lt;p&gt;So I&apos;m not sure which is to blame, if the import is returning invalid data, or that alterTableSql ultimately misinterprets it, but, the end result is an incorrect ALTER command.&lt;/p&gt;
</description>
                <environment>MySQL 5.1, PHP 5.3.1, Doctrine 1.2 branch latest.</environment>
            <key id="11636">DC-793</key>
            <summary>import-&gt;listTableColumns / export-&gt;alterTableSql issues</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="drak">Karma Dordrak (Drak)</reporter>
                        <labels>
                    </labels>
                <created>Sat, 17 Jul 2010 18:03:18 +0000</created>
                <updated>Sat, 17 Jul 2010 18:03:18 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-789] Better documentation for the generated getInstance method in generated *Table.class.php files</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-789</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;As stated in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-518&quot; class=&quot;external-link&quot;&gt;DC-518&lt;/a&gt; the getInstance method is added in table classes generated by Doctrine 1.2.2. The problem is, that the word order is wrong for the parameter keyword to support auto completion in IDEs. At least the NetBeans IDE is not able to use this information properly.&lt;/p&gt;

&lt;p&gt;As it is common to expect phpDocumentor comment syntax, the first word after the @param keyword specifies the type, which is in the current version &lt;cite&gt;object&lt;/cite&gt;. It would be really helpful if the current form could be changed from&lt;/p&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;Doctrine/Import/Builder.php:1077&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;* @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; object %s
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;to&lt;/p&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;Doctrine/Import/Builder.php:1077&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;* @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; %s
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;as it was propossed in the above mentioned issue.&lt;/p&gt;</description>
                <environment>Symfony 1.4.6 with Doctrine 1.2.2 on Debian Linux 5.0</environment>
            <key id="11631">DC-789</key>
            <summary>Better documentation for the generated getInstance method in generated *Table.class.php files</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="cberg">Christoph Berg</reporter>
                        <labels>
                    </labels>
                <created>Fri, 16 Jul 2010 03:02:11 +0000</created>
                <updated>Fri, 16 Jul 2010 03:02:11 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>2</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-783] Doing introspection of postgres datagbases with sequences for columns does not generate &apos;nextval(sequence_name)::regclass&apos; for default value</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-783</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;After database is introspected, yaml file worked on for minor tweeks, and normal development cycle of  drop database/rebuild database &amp;amp; sql, regular sql scrips and build in fuctions expecting the sequenced primary key columns to automatically create their own id from the sequence is broken. Found that in no case does this version of Doctrine put into the YML file&lt;/p&gt;

&lt;p&gt;&apos;nextval(sequenceName_seq&apos;::regclass)&lt;/p&gt;

&lt;p&gt;for the default value of the autoincrementing columns. Doing so should not affect any operation of the Doctrine library, as Doctrine gets the value independently by that exact call, and inserts that value into the column during inserts.&lt;/p&gt;

&lt;p&gt;BUT, *&lt;b&gt;NOT&lt;/b&gt;* having that as the default value BREAKS any SQL scripts or quick and dirty tasks via PGADMIN3 or any stored procedures expecting the column to assign itself the default value.&lt;/p&gt;

&lt;p&gt;Summary, it won&apos;t hurt doctrine&apos;s operation&lt;br/&gt;
but it&apos;ll help non doctrine operations.&lt;/p&gt;

&lt;p&gt;Seems like it should be done.&lt;/p&gt;</description>
                <environment>ubuntu/apache/postgres/php (LAP2/LAPP) Symfony 1.4.4 unmodified (orignal doctrine)</environment>
            <key id="11616">DC-783</key>
            <summary>Doing introspection of postgres datagbases with sequences for columns does not generate &apos;nextval(sequence_name)::regclass&apos; for default value</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gearond">Dennis Gearon</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Jul 2010 13:11:44 +0000</created>
                <updated>Mon, 12 Jul 2010 13:26:57 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13572" author="gearond" created="Mon, 12 Jul 2010 13:26:57 +0000"  >&lt;p&gt;I tried manually adding the default value to the yml file and symfony/doctrine ignores it - it never gets set in the next newly created database. Hmmmmm.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-733] Length validator fail because it was bad initialized</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-733</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;import/Oracle.php&lt;/p&gt;

&lt;p&gt;        foreach($result as $val) &lt;/p&gt;
{
            $val = array_change_key_case($val, CASE_LOWER);
            $decl = $this-&amp;gt;conn-&amp;gt;dataDict-&amp;gt;getPortableDeclaration($val);

            $descr[$val[&apos;column_name&apos;]] = array(
               &apos;name&apos;       =&amp;gt; $val[&apos;column_name&apos;],
               &apos;notnull&apos;    =&amp;gt; (bool) ($val[&apos;nullable&apos;] === &apos;N&apos;),
               &apos;ntype&apos;      =&amp;gt; $val[&apos;data_type&apos;],
               &apos;type&apos;       =&amp;gt; $decl[&apos;type&apos;][0],
               &apos;alltypes&apos;   =&amp;gt; $decl[&apos;type&apos;],
               &apos;fixed&apos;      =&amp;gt; $decl[&apos;fixed&apos;],
               &apos;unsigned&apos;   =&amp;gt; $decl[&apos;unsigned&apos;],
               &apos;default&apos;    =&amp;gt; $val[&apos;data_default&apos;],
               &apos;length&apos;     =&amp;gt; $val[&apos;data_length&apos;],
               &apos;primary&apos;    =&amp;gt; $val[&apos;primary&apos;] ? true:false,
               &apos;scale&apos;      =&amp;gt; isset($val[&apos;scale&apos;]) ? $val[&apos;scale&apos;]:null,
            );
        }




&lt;p&gt; &apos;length&apos;     =&amp;gt; $val&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;data_length&amp;#39;&amp;#93;&lt;/span&gt;,&lt;br/&gt;
doesn&apos;t use the $decl = $this-&amp;gt;conn-&amp;gt;dataDict-&amp;gt;getPortableDeclaration($val); witch make it Portable&lt;br/&gt;
use this instead&lt;br/&gt;
&apos;length&apos;     =&amp;gt; $decl&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;length&amp;#39;&amp;#93;&lt;/span&gt;,&lt;/p&gt;</description>
                <environment>Oracle</environment>
            <key id="11487">DC-733</key>
            <summary>Length validator fail because it was bad initialized</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="tripollite">Pierre</reporter>
                        <labels>
                    </labels>
                <created>Mon, 14 Jun 2010 08:02:28 +0000</created>
                <updated>Mon, 14 Jun 2010 08:02:28 +0000</updated>
                                                                    <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-724] Blameable relations import problem</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-724</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The import works only when i DISABLE the update relation. When i activate the update relation i get an sql error&lt;/p&gt;

&lt;p&gt;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;23000&amp;#93;&lt;/span&gt;: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`clubicious`.`location`, CONSTRAINT `location_updated_by_sf_guard_user_id` FOREIGN KEY (`updated_by`) REFERENCES `sf_guard_user` (`id`))&lt;/p&gt;

&lt;p&gt;The relation is created correct i think the problem is in the importer???&lt;/p&gt;

&lt;p&gt;Location:&lt;br/&gt;
  actAs:&lt;br/&gt;
    Timestampable: ~&lt;br/&gt;
    Sortable: ~&lt;br/&gt;
    Blameable:&lt;br/&gt;
      columns:&lt;br/&gt;
        created:&lt;br/&gt;
          length: null&lt;br/&gt;
        updated:&lt;br/&gt;
          length: null&lt;br/&gt;
      relations:&lt;br/&gt;
        created:&lt;br/&gt;
          disabled: false&lt;br/&gt;
          class:    sfGuardUser&lt;br/&gt;
        updated:&lt;br/&gt;
          disabled: false&lt;br/&gt;
          class:    sfGuardUser&lt;br/&gt;
  columns:&lt;br/&gt;
    name:         &lt;/p&gt;
{ type: string(255), notnull: true }

&lt;p&gt;My fixtures:&lt;br/&gt;
sfGuardUser:&lt;br/&gt;
  gfranke:&lt;br/&gt;
    id: 1&lt;br/&gt;
    first_name: Gordon&lt;br/&gt;
    last_name: Franke&lt;br/&gt;
    email_address: franke@clubicious.com&lt;br/&gt;
    username: gfranke&lt;br/&gt;
    password: startgf&lt;br/&gt;
Location:&lt;br/&gt;
  location_atomic:&lt;br/&gt;
    name:         Atomic Cafe&lt;br/&gt;
    CreatedBy:    gfranke&lt;br/&gt;
    UpdatedBy:    gfranke&lt;/p&gt;

&lt;p&gt;  location_max:&lt;br/&gt;
    name:         Max &amp;amp; Moritz&lt;br/&gt;
    CreatedBy:    gfranke&lt;br/&gt;
    UpdatedBy:    gfranke&lt;/p&gt;</description>
                <environment>symfony 1.4.5 with latest doctrine 1.2 branch with sfDoctrineGuardPlugin</environment>
            <key id="11464">DC-724</key>
            <summary>Blameable relations import problem</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gimler">Gordon Franke</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Jun 2010 06:06:06 +0000</created>
                <updated>Tue, 13 Jul 2010 07:00:31 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Extensions</component>
                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13573" author="timschofield" created="Tue, 13 Jul 2010 07:00:31 +0000"  >&lt;p&gt;Same Problem with Doctrine 1.2.2 and  Zend Framework 1.10&lt;/p&gt;

&lt;p&gt;Work around for me was to disable all Blameable relations in my schema.yml&lt;/p&gt;

&lt;p&gt;Then run &lt;/p&gt;

&lt;p&gt;./doctrine build-all-reload&lt;/p&gt;

&lt;p&gt;So that fixtures can load&lt;/p&gt;


&lt;p&gt;Then enable all Blameable relations in the schema.yml&lt;/p&gt;

&lt;p&gt;and run&lt;/p&gt;

&lt;p&gt;./doctrine generate-models-yaml&lt;/p&gt;

&lt;p&gt;So models are generated with the correct relations&lt;/p&gt;

&lt;p&gt;Regards&lt;/p&gt;

&lt;p&gt;Tim&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-708] Wrong definition for MySQL string primary column</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-708</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If you define a primary column, the attribute &lt;b&gt;notnull&lt;/b&gt; is removed from the column definition because Doctrine assumes that primary columns are always not null.&lt;/p&gt;

&lt;p&gt;Now suppose you have a schema like this, with a &lt;b&gt;string&lt;/b&gt; primary column.&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;Client:
  columns:
    serial:    { type: string(50), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
    name:      { type: string(36), notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That&apos;s fine, but causes problems with MySQL where the column is created with a default value of &quot;&quot; (empty string) and not &amp;lt;none&amp;gt;.&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;CREATE TABLE client (serial VARCHAR(50), name VARCHAR(36) NOT NULL, PRIMARY KEY(serial)) ENGINE = INNODB;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Note that the 2nd column is well defined and has &amp;lt;none&amp;gt; as default value (as seen from phpMyAdmin).&lt;/p&gt;

&lt;p&gt;I attached a quick-workaround to disable the code which removes the &lt;b&gt;notnull&lt;/b&gt; attribute from column definition.&lt;/p&gt;

&lt;p&gt;After that the SQL code is like this:&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;CREATE TABLE client (serial VARCHAR(50) NOT NULL, name VARCHAR(36) NOT NULL, PRIMARY KEY(serial)) ENGINE = INNODB;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>PHP 5.3.1, WinXP-SP3, Doctrine 1.2.2, MySQL 5.1.41</environment>
            <key id="11422">DC-708</key>
            <summary>Wrong definition for MySQL string primary column</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="nicorac">Claudio Nicora</reporter>
                        <labels>
                    </labels>
                <created>Fri, 28 May 2010 08:41:16 +0000</created>
                <updated>Mon, 12 Jul 2010 16:32:44 +0000</updated>
                                    <version>1.2.2</version>
                                <fixVersion>1.2.2</fixVersion>
                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13078" author="nicorac" created="Fri, 28 May 2010 09:08:46 +0000"  >&lt;p&gt;Attached a better patch where the &lt;b&gt;notnull&lt;/b&gt; attribute is removed only if the primary column type is &lt;b&gt;string&lt;/b&gt;&lt;/p&gt;</comment>
                    <comment id="13079" author="nicorac" created="Fri, 28 May 2010 09:25:01 +0000"  >&lt;p&gt;The same behaviour happens even for integer columns, so the &lt;b&gt;notnull&lt;/b&gt; attribute should never be removed, not only for string columns. New patch attached, old one removed.&lt;/p&gt;</comment>
                    <comment id="13145" author="jwage" created="Tue, 8 Jun 2010 09:58:05 +0000"  >&lt;p&gt;The patch I see currently just comments out the offending code. Is that intended? It cannot be committed if so &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="13155" author="nicorac" created="Tue, 8 Jun 2010 10:33:26 +0000"  >&lt;p&gt;My patch only removed the effect, but it&apos;s not surely the best solution.&lt;/p&gt;

&lt;p&gt;I&apos;ve no sufficient knowledge on Doctrine to say that commenting out (or removing) that line will not affect other parts; that&apos;s why I only commented out the code instead of removing it (both on my side and on the attached patch).&lt;/p&gt;

&lt;p&gt;If you think I&apos;m not adding new bugs, I agree that removing the offending code is the cleanest way.&lt;/p&gt;</comment>
                    <comment id="13156" author="jwage" created="Tue, 8 Jun 2010 10:36:00 +0000"  >&lt;p&gt;We can&apos;t just remove the code. It will change the behavior of the builder drastically which breaks backwards compatibility.&lt;/p&gt;</comment>
                    <comment id="13168" author="nicorac" created="Tue, 8 Jun 2010 11:46:12 +0000"  >&lt;p&gt;That&apos;s what I was afraid of.&lt;br/&gt;
Maybe you should change the code that generates the SQL for MySQL to make it include the &quot;NOT NULL&quot; clause to primary keys.&lt;/p&gt;</comment>
                    <comment id="13169" author="jwage" created="Tue, 8 Jun 2010 11:48:02 +0000"  >&lt;p&gt;Hi, if you want to provide a patch that fixes your situation I can test it against our test suite and see if we can include it. You can also run your changes against the test suite to see if it causes any problems.&lt;/p&gt;</comment>
                    <comment id="13285" author="nicorac" created="Sun, 13 Jun 2010 05:39:19 +0000"  >&lt;p&gt;Hi, I attached a patch against Export/Mysql.php instead of the previous against Import/Builder.php.&lt;br/&gt;
It works on my side; can you please test it with your test suite?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10642" name="export_mysql_patch.diff" size="765" author="nicorac" created="Sun, 13 Jun 2010 05:39:39 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-864] Generating YAML schema from model should pick up also charset, collate and other options</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-864</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I did change Doctrine/Export/Schema.php to pick up some options from model, then they get exported into YAML schema by current code.&lt;/p&gt;

&lt;p&gt;Adding the patch. (sorry, can&apos;t run the tests, so I&apos;m not sure whether it does break something, really shouldn&apos;t)&lt;/p&gt;

&lt;p&gt;In my project it works just as expected (did need it for the way I do migrations).&lt;/p&gt;

&lt;p&gt;TODO for Doctrine devs:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;run tests with my patch and let me know if there&apos;s a problem&lt;/li&gt;
	&lt;li&gt;consider other option names, which are worth of export, so far I did need &quot;charset&quot; and &quot;collate&quot;, and I added &quot;queryParts&quot; as well.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I hope my additions make sense and will help you to improve Doctrine project. (and that you will include it, so I don&apos;t have custom modified Doctrine &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;)&lt;/p&gt;</description>
                <environment></environment>
            <key id="11904">DC-864</key>
            <summary>Generating YAML schema from model should pick up also charset, collate and other options</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ped">Peter Helcmanovsky</reporter>
                        <labels>
                    </labels>
                <created>Fri, 10 Sep 2010 06:15:08 +0000</created>
                <updated>Mon, 10 Jan 2011 09:51:03 +0000</updated>
                                                                    <component>Import/Export</component>
                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15118" author="ped" created="Mon, 10 Jan 2011 09:51:03 +0000"  >&lt;p&gt;By hunting down an eluding bug I figured out (i.e. by hard way) that the indexes are dropped as well during YAML generation.&lt;/p&gt;

&lt;p&gt;I will do another pull request on github including another 3 lines to fix that...&lt;/p&gt;

&lt;p&gt;I see this issue is ignored anyway by core devs.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10784" name="Export_Schema.patch" size="863" author="ped" created="Fri, 10 Sep 2010 06:15:08 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1005] Schema importer sometimes overwrites relations (instead of adding them) due to issue with bugfix DC-281</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1005</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;The bugfix for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-281&quot; title=&quot;Generate Models Db changes case in Relationship definition.&quot;&gt;&lt;del&gt;DC-281&lt;/del&gt;&lt;/a&gt; (r6802) contains an issue:&lt;/p&gt;

&lt;p&gt;When between two tables in a MySQL database there are two relations, one on both sides (i.e. both tables have a FK field to each other), one of the two is overwritten with the second by the schema importer. That is, at one class, there seems to be only one relation instead of both.&lt;/p&gt;

&lt;p&gt;The issue came in when the decision was made to store all class names in the definition array lower case, as one of the lookups in the array was not updated appropriately.&lt;/p&gt;

&lt;p&gt;See Doctrine/Import.php (1.2.4) line 416 - 435. In line 427, you can clearly see the change made in 6802&lt;/p&gt;

&lt;p&gt;Old:&lt;br/&gt;
&lt;tt&gt;$definitions[$relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relations&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$alias&amp;#93;&lt;/span&gt; = array(&lt;/tt&gt;&lt;br/&gt;
New:&lt;br/&gt;
&lt;tt&gt;$definitions[strtolower($relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;)]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relations&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$alias&amp;#93;&lt;/span&gt; = array(&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Line 421 however should also have been updated:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;if (in_array($relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;, $relClasses) || isset($definitions[$relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relations&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$className&amp;#93;&lt;/span&gt;)) {&lt;/tt&gt;&lt;br/&gt;
Proposed fix:&lt;br/&gt;
&lt;tt&gt;if (in_array($relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;, $relClasses) || isset($definitions[strtolower($relation&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;class&amp;#39;&amp;#93;&lt;/span&gt;)]&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relations&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$className&amp;#93;&lt;/span&gt;)) {&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;This error results in relations that already exist sometimes being overwritten.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12641">DC-1005</key>
            <summary>Schema importer sometimes overwrites relations (instead of adding them) due to issue with bugfix DC-281</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="pelleke">Pelle ten Cate</reporter>
                        <labels>
                    </labels>
                <created>Tue, 17 May 2011 11:47:49 +0000</created>
                <updated>Tue, 17 May 2011 11:47:49 +0000</updated>
                                    <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-987] redundant sql statement in Doctrine_Export_Oracle::_makeAutoincrement()</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-987</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;line 121-128 of Doctrine_Export_Oracle appears to generate redundant code for creating a primary key constraint as primary keys (defined in schema.yml) are already generated during CREATE TABLE statements.&lt;/p&gt;</description>
                <environment>linux, oracle</environment>
            <key id="12481">DC-987</key>
            <summary>redundant sql statement in Doctrine_Export_Oracle::_makeAutoincrement()</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="temperedvision">David Dixon</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Mar 2011 12:35:54 +0000</created>
                <updated>Mon, 21 Mar 2011 12:35:54 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-457] Generating YAML schema from DB breaks on certain table names</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-457</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When attempting to reverse engineer databases using the generate-yaml-db task (via Symfony&apos;s doctrine:build-schema task), I&apos;ve run into some issues due to table names not being compatible with PHP classnames. It creates the PHP classes in /tmp, setting the class name to the same as the table name, and then attempts to build the YAML files off of those.&lt;/p&gt;

&lt;p&gt;I attempted to do this a few months ago and ran into issues because some of the table names began with numbers (&quot;123MyTable&quot; is not a valid PHP class name). My most recent attempt failed because of a table named &quot;List&quot;, which is a reserved PHP keyword.&lt;/p&gt;

&lt;p&gt;While I&apos;m not sure if this is the ideal solution, I think allowing a way to pre-define a prefix for the generated PHP class names would be great.&lt;/p&gt;</description>
                <environment>Linux, Symfony 1.4.1, Doctrine 1.2.1</environment>
            <key id="10788">DC-457</key>
            <summary>Generating YAML schema from DB breaks on certain table names</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ari">Ari Pringle</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Jan 2010 23:49:21 +0000</created>
                <updated>Wed, 17 Mar 2010 19:25:09 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11787" author="chipnet" created="Mon, 22 Feb 2010 11:43:36 +0000"  >&lt;p&gt;I think there seems to be a general problem in usage of table names, when using the generating from database to yml.&lt;/p&gt;

&lt;p&gt;I think there something changed with the naming stragegies in the last versions (I do not know in wich one), but it works with doctrine 1.0.10 (used in symfony 1.2.8).&lt;/p&gt;

&lt;p&gt;theoretical stragegies:&lt;br/&gt;
1. Only the first letter is a capital (e.g. ProjectCategory --&amp;gt; Projectcategory)&lt;br/&gt;
2. When a _ is inside the name, the _ is removed an a capital will used (e.g. Project_Values --&amp;gt; ProjectValues)&lt;/p&gt;

&lt;p&gt;But doctrine does not make use of this anymore. When I generate with doctrine 1.2.1 (used in symfony 1.3.2) my table ProjectCategory will be named as ProjectCategory in schema. And when the schema is wrong, all generated models are incompatible to older versions.&lt;/p&gt;
</comment>
                    <comment id="11911" author="jwage" created="Mon, 1 Mar 2010 18:08:05 +0000"  >&lt;p&gt;Hmm. I don&apos;t quite understand. I tested the things you described and it all works as I expected it to. You&apos;ll have to provide some more information.&lt;/p&gt;</comment>
                    <comment id="12312" author="ari" created="Wed, 17 Mar 2010 19:25:09 +0000"  >&lt;p&gt;Sorry for the delay in response.&lt;/p&gt;

&lt;p&gt;Here&apos;s how to reproduce my original issue (I should also mention that I&apos;m running PHP 5.2.4):&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;mysql&amp;gt; create table List (id &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; not &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; auto_increment,primary key(id));
&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;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;bash$ ./symfony doctrine:build-schema
&amp;gt;&amp;gt; doctrine  generating yaml schema from database

Parse error: syntax error, unexpected T_LIST, expecting T_STRING in /tmp/tmp_doctrine_models/List.php on line 17

bash$ sed -n &apos;17p&apos; /tmp/tmp_doctrine_models/List.php 
class List &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The same thing happens if the table name begins with a number (ie 123MyTable).&lt;/p&gt;

&lt;p&gt;Again, I&apos;m not sure if this is the ideal solution, but being able to define a prefix to the generated class names would take care of this issue (so the generated class name above could be MyPrefix_List instead of List)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-780] Foreign key creation fails with MySQL 5.0.44</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-780</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi there,&lt;/p&gt;

&lt;p&gt;When executing symfony doctrine:build --all --and-load  on a machine using Mysql 5.0.44 I get the following error:&lt;/p&gt;

&lt;p&gt;  SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &apos;dimension(id)&apos; at line 1. Failing Query: &quot;ALTER TABLE kpi_dimension ADD CONSTRAINT kpi_dimension_dimension_id_dimension_id FOREIGN KEY (dimension_id) REFERENCES dimension(id)&quot;. &lt;/p&gt;

&lt;p&gt;The problem can be fixed by adding a space between the table name and the column name that is referenced. So instead of&lt;br/&gt;
&lt;tt&gt;REFERENCES dimension(id)&lt;/tt&gt;&lt;br/&gt;
it should be&lt;br/&gt;
&lt;tt&gt;REFERENCES dimension (id)&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Since it works fine on MySQL 5.1.37, I normally would file this under Mysql bug. But as the &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html&quot; class=&quot;external-link&quot;&gt;syntax for a foreign key constraint in MySQL&lt;/a&gt; mentions this space it should be ok to simply add the space to the script creating the sql for the foreign key. I have not tried any other DBMS though.&lt;/p&gt;

&lt;p&gt;The patch for the file Export.php is attached.&lt;/p&gt;

&lt;p&gt;Best regards&lt;/p&gt;

&lt;p&gt;Claudia&lt;/p&gt;</description>
                <environment>gentoo, MySQL 5.0.44-log, Doctrine 1.2, symfony 1.4.4</environment>
            <key id="11601">DC-780</key>
            <summary>Foreign key creation fails with MySQL 5.0.44</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="claudia_k">Claudia Kosny</reporter>
                        <labels>
                    </labels>
                <created>Fri, 9 Jul 2010 04:23:24 +0000</created>
                <updated>Fri, 9 Jul 2010 04:23:24 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10695" name="Doctrine-Export.patch" size="611" author="claudia_k" created="Fri, 9 Jul 2010 04:23:24 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-737] generateModelsFromYaml with (generateTableClasses = true) doesn&apos;t generate tables classes if (generateBaseClasses = false)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-737</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I can&apos;t see the reason why Table classes are only generated if Base classes are... (the same occurs for Package classes, but regarding code comments a Package is required to extend a Base class... but a Table can&apos;t and won&apos;t...)&lt;/p&gt;

&lt;p&gt;Here is some... patch? :s (it doesn&apos;t make unit tests to fail)&lt;/p&gt;

&lt;p&gt;Best regards&lt;/p&gt;</description>
                <environment>Doctrine SVN 1.2 r.7676</environment>
            <key id="11495">DC-737</key>
            <summary>generateModelsFromYaml with (generateTableClasses = true) doesn&apos;t generate tables classes if (generateBaseClasses = false)</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gx">Guilliam X</reporter>
                        <labels>
                    </labels>
                <created>Tue, 15 Jun 2010 09:26:14 +0000</created>
                <updated>Tue, 15 Jun 2010 09:27:54 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10653" name="DC-737.patch" size="948" author="gx" created="Tue, 15 Jun 2010 09:27:47 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1029] Extensions of Doctrine_Template_I18n incompatible with Doctrine_Import</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1029</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Extending Doctrine_Template_I18n class make Doctrine_Import on YAML data with translation fails...&lt;/p&gt;

&lt;p&gt;Why ? Just because of this line :&lt;/p&gt;

&lt;p&gt;Doctrine_Import.php, line 135 :&lt;br/&gt;
                if ($table-&amp;gt;hasRelation($key) &amp;amp;&amp;amp; is_array($value) &amp;amp;&amp;amp; ! $table-&amp;gt;hasTemplate(&apos;Doctrine_Template_I18n&apos;)) {&lt;/p&gt;

&lt;p&gt;In fact, having a template named &quot;Doctrine_Template_I18n&quot; is not strong enough to be sure that the current object has an I18n behavior.&lt;/p&gt;


&lt;p&gt;The bug is very simple to reproduce :&lt;/p&gt;

&lt;p&gt;1. Get a classic I18n fixtures like :&lt;/p&gt;

&lt;p&gt;Article:&lt;br/&gt;
  Translation:&lt;br/&gt;
     en:&lt;br/&gt;
       title: Lorem Ipsum&lt;/p&gt;

&lt;p&gt;2. Then make a simple extension of the I18n template (do not do anything else but extends the Doctrine_Template_I18n class) :&lt;/p&gt;

&lt;p&gt;class My_Doctrine_Template_I18n extends Doctrine_Template_I18n {}&lt;/p&gt;

&lt;p&gt;3. Load the extension, assign it to your model and try to import your fixtures again. It will not work anymore.&lt;/p&gt;


&lt;p&gt;Thanks&lt;/p&gt;</description>
                <environment>Windows 7, XAMPP 1.7.4 with APC and Curl, symfony 1.4.8</environment>
            <key id="12931">DC-1029</key>
            <summary>Extensions of Doctrine_Template_I18n incompatible with Doctrine_Import</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="loops">Pierrot Evrard</reporter>
                        <labels>
                    </labels>
                <created>Thu, 18 Aug 2011 11:16:34 +0000</created>
                <updated>Thu, 18 Aug 2011 11:36:19 +0000</updated>
                                    <version>1.2.4</version>
                                                <component>Data Fixtures</component>
                <component>I18n</component>
                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16350" author="loops" created="Thu, 18 Aug 2011 11:18:51 +0000"  >&lt;p&gt;See this patch where to check if the table has the I18n plugin, I check if one of the templates has a getI18n() method.&lt;/p&gt;

&lt;p&gt;This is probably not strong enough but it can do the job until you find a better solution.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="16351" author="loops" created="Thu, 18 Aug 2011 11:36:19 +0000"  >&lt;p&gt;Another possibility to check that templates are I18n template, will be to create an Doctrine_I18n_Interface. Also, every template that include this interface can be considered as I18n templates.&lt;/p&gt;

&lt;p&gt;What do you think about that ?&lt;/p&gt;

&lt;p&gt;NB: May the interface can define the method getI18n() to be declared...&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11056" name="DC-1029.patch" size="1184" author="loops" created="Thu, 18 Aug 2011 11:18:51 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-784] Removed unuseful code</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-784</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Self assignments like:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;$table = $table;&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;are unuseful and could be safely removed.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11619">DC-784</key>
            <summary>Removed unuseful code</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="nicorac">Claudio Nicora</reporter>
                        <labels>
                    </labels>
                <created>Tue, 13 Jul 2010 05:38:37 +0000</created>
                <updated>Tue, 13 Jul 2010 05:38:37 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Import/Export</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10696" name="patch.diff" size="822" author="nicorac" created="Tue, 13 Jul 2010 05:38:37 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>