<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Tue May 21 17:24:41 UTC 2013

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

<item>
            <title>[DC-582] DataDict entry missing for datetime type for MySQL causes migrations to fail due to sql error</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-582</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I discovered this whilst trying out migrations via symfony. I added a datetime field to my schema.yml and generated the migrations, but upon running the migration I got 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;()&apos; at line 1. Failing Query: &quot;ALTER TABLE order_item ADD purchased_at datetime()&quot;&lt;/p&gt;

&lt;p&gt;The following code causes the failure in the actual migration:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;addColumn(&apos;order_item&apos;, &apos;purchased_at&apos;, &apos;datetime&apos;, &apos;&apos;, array());&lt;/p&gt;

&lt;p&gt;because it generates the following sql:&lt;/p&gt;

&lt;p&gt;ALTER TABLE order_item ADD purchased_at datetime()&lt;/p&gt;

&lt;p&gt;The diff from my patched version which fixes the issue is as follows:&lt;/p&gt;

&lt;p&gt;Index: Doctrine/DataDict/Mysql.php&lt;br/&gt;
===================================================================&lt;br/&gt;
&amp;#8212; Doctrine/DataDict/Mysql.php	(revision 7415)&lt;br/&gt;
+++ Doctrine/DataDict/Mysql.php	(working copy)&lt;br/&gt;
@@ -227,6 +227,7 @@&lt;br/&gt;
                 return &apos;DATE&apos;;&lt;br/&gt;
             case &apos;time&apos;:&lt;br/&gt;
                 return &apos;TIME&apos;;&lt;br/&gt;
+            case &apos;datetime&apos;:&lt;br/&gt;
             case &apos;timestamp&apos;:&lt;br/&gt;
                 return &apos;DATETIME&apos;;&lt;br/&gt;
             case &apos;float&apos;:&lt;/p&gt;

&lt;p&gt;It&apos;s against the following repository file:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://doctrine.mirror.svn.symfony-project.com/branches/1.2/lib/Doctrine/DataDict/Mysql.php&quot; class=&quot;external-link&quot;&gt;http://doctrine.mirror.svn.symfony-project.com/branches/1.2/lib/Doctrine/DataDict/Mysql.php&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;I hope this is useful and gets committed &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>LAMP</environment>
            <key id="11080">DC-582</key>
            <summary>DataDict entry missing for datetime type for MySQL causes migrations to fail due to sql error</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="uncleringo">Rich Birch</reporter>
                        <labels>
                    </labels>
                <created>Thu, 18 Mar 2010 09:27:27 +0000</created>
                <updated>Tue, 10 Jan 2012 10:11:51 +0000</updated>
                    <resolved>Mon, 29 Mar 2010 14:29:12 +0000</resolved>
                            <version>1.2.0</version>
                <version>1.2.1</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12426" author="uncleringo" created="Mon, 22 Mar 2010 11:19:18 +0000"  >&lt;p&gt;I&apos;ve just discovered that the same issue exists for fields of type &apos;text&apos;:&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;) NOT NULL, session_time DATETIME NOT NULL, INDEX session_id_index_idx (session_&apos; at line 1. Failing Query: &quot;CREATE TABLE session (id BIGINT AUTO_INCREMENT, session_id VARCHAR(64) NOT NULL, session_data text() NOT NULL, session_time DATETIME NOT NULL, INDEX session_id_index_idx (session_id), PRIMARY KEY(id)) ENGINE = INNODB&quot;&lt;/p&gt;

&lt;p&gt;from the following schema:&lt;/p&gt;

&lt;p&gt;Session:&lt;br/&gt;
  columns:&lt;br/&gt;
    session_id:       &lt;/p&gt;
{ type: string(64), notnull: true }
&lt;p&gt;    session_data:     &lt;/p&gt;
{ type: text, notnull: true }
&lt;p&gt;    session_time:     &lt;/p&gt;
{ type: timestamp, notnull: true }
&lt;p&gt;  indexes:&lt;br/&gt;
    session_id_index:&lt;br/&gt;
      fields: [ session_id ]&lt;br/&gt;
      unique: true&lt;/p&gt;

&lt;p&gt;I guess there may be other field entries missing too. Is there a comprehensive list of doctrine field types somewhere?&lt;/p&gt;</comment>
                    <comment id="12427" author="uncleringo" created="Mon, 22 Mar 2010 11:26:57 +0000"  >&lt;p&gt;Ok, I might have been being dumb here. I&apos;ve just checked the doctrine documentation for defining the schema (&lt;a href=&quot;http://www.doctrine-project.org/documentation/manual/1_2/en/defining-models&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/documentation/manual/1_2/en/defining-models&lt;/a&gt;) and there&apos;s no mention of a datetime or text field (I&apos;ve just realised that I should have used string instead of text anyway), but datetime still works as a column type so shouldn&apos;t it be documented?&lt;/p&gt;

&lt;p&gt;I guess either datetime should be fully removed or fully supported&lt;/p&gt;</comment>
                    <comment id="12497" author="jwage" created="Mon, 29 Mar 2010 14:29:12 +0000"  >&lt;p&gt;You should be using the Doctrine portable types. So you would use date or timestamp I believe and Doctrine will convert it to the appropriate type for your dbms.&lt;/p&gt;</comment>
                    <comment id="17210" author="tolean" created="Tue, 10 Jan 2012 10:11:51 +0000"  >&lt;p&gt;not correctly generated migration, in my case generated:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;addColumn(&apos;tree&apos;, &apos;published_at&apos;, &apos;datetime&apos;, &apos;&apos;, array(&lt;br/&gt;
             ));&lt;/p&gt;

&lt;p&gt;but if change the fourth parameters on null, all ok&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>