<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Fri May 24 04:47:23 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/DDC-993/DDC-993.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>[DDC-993] Cookbook: Overriding the ID Generator during a database migration</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-993</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;If you need to override the ID Generator, e.g. during a migration, you can do that in your migration script as follows:&lt;/p&gt;

&lt;div class=&quot;panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;Overriding the ID generator&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;panelContent&quot;&gt;
&lt;p&gt;$em-&amp;gt;getClassMetadata(&apos;foo\bar\Entity&apos;)-&amp;gt;setIdGenerator(new \Doctrine\ORM\Id\AssignedGenerator());&lt;br/&gt;
$em-&amp;gt;getClassMetadata(&apos;foo\bar\Entity&apos;)-&amp;gt;setIdGeneratorType(constant(&apos;Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_NONE&apos;));&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Make sure that both calls equal to the same generator type. You can now modify the @Id fields in your entities. Additionally, make sure that you set the IdGenerator &lt;b&gt;after&lt;/b&gt; you created the database using e.g. SchemaTool-&amp;gt;create().&lt;/p&gt;</description>
                <environment></environment>
            <key id="12311">DDC-993</key>
            <summary>Cookbook: Overriding the ID Generator during a database migration</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="felicitus">Timo A. Hummel</reporter>
                        <labels>
                    </labels>
                <created>Wed, 19 Jan 2011 13:33:27 +0000</created>
                <updated>Sun, 28 Oct 2012 15:33:51 +0000</updated>
                                    <version>2.0</version>
                                                <component>Documentation</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="18892" author="kosen" created="Sat, 27 Oct 2012 21:36:37 +0000"  >&lt;p&gt;Hi, this doesn&apos;t seem to work for me. I have written a small database export / import utility. As long as I use the automatic ID generation, everything works flawlessly, but I&apos;m trying to preserve the existing IDs. I do exactly what you&apos;ve suggested in your post. It works for @OneToOne relations, but I get the following error messages when persisting entities that are parts of @ManyToOne relations:&lt;br/&gt;
Notice: Undefined index: &lt;span class=&quot;error&quot;&gt;&amp;#91;....&amp;#93;&lt;/span&gt; in &lt;span class=&quot;error&quot;&gt;&amp;#91;...&amp;#93;&lt;/span&gt;Doctrine/ORM/UnitOfWork.php on line 2655&lt;br/&gt;
I&apos;m using version 2.2.2&lt;br/&gt;
Am I doing something wrong?&lt;/p&gt;</comment>
                    <comment id="18894" author="kosen" created="Sun, 28 Oct 2012 15:33:51 +0000"  >&lt;p&gt;Never mind. I&apos;ve upgraded to Doctrine 2.3.0 and it works as expected.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>