<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sat May 25 18:28:44 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-755/DC-755.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-755] CLONE [DC-558] incorrect handling of MODEL_CLASS_PREFIX causes Doctrine_Migration_Diff to drop the whole database when working from YAML (Regression)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-755</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Replicating the bug:&lt;br/&gt;
1. Set ATTR_MODEL_CLASS_PREFIX non-null&lt;br/&gt;
2. create schema file with entity&lt;br/&gt;
3. run doctrine build-all&lt;br/&gt;
4. copy schema file&lt;br/&gt;
5. edit schema file to add column to entity&lt;br/&gt;
6. run generate-migrations-diff from copy of schema file to edited schema file&lt;/p&gt;

&lt;p&gt;Expected (previous) behaviour:&lt;br/&gt;
Migration is generated to add the new column to entity&lt;/p&gt;

&lt;p&gt;Real behaviour:&lt;br/&gt;
Drops entity from database and creates new&lt;/p&gt;</description>
                <environment>Current HEAD of Doctrine 1.2</environment>
            <key id="11528">DC-755</key>
            <summary>CLONE [DC-558] incorrect handling of MODEL_CLASS_PREFIX causes Doctrine_Migration_Diff to drop the whole database when working from YAML (Regression)</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="andrewcoulton">Andrew Coulton</reporter>
                        <labels>
                    </labels>
                <created>Sun, 20 Jun 2010 09:58:04 +0000</created>
                <updated>Sun, 10 Oct 2010 18:51:58 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13377" author="andrewcoulton" created="Sun, 20 Jun 2010 10:08:30 +0000"  >&lt;p&gt;This seems to be a regression caused by the fix for &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-558&quot; title=&quot;CLONE -generate-migrations-diff is producing bogus migrations (drops the whole database)&quot;&gt;&lt;del&gt;DC-558&lt;/del&gt;&lt;/a&gt; which added the MODEL_CLASS_PREFIX to the $_toPrefix in Doctrine_Migration_Diff::generateChanges.&lt;/p&gt;

&lt;p&gt;While this fixed the issue when generating diff from models to YAML, it has now created the reverse issue for generating diffs from YAML to YAML - as the models generated for the &quot;from&quot; schema do not get MODEL_CLASS_PREFIX prepended and so now this command will drop all existing tables and recreate.&lt;/p&gt;

&lt;p&gt;I believe the fix may be to amend as:&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;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unable to find source-code formatter for language: php.&lt;/span&gt; Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml&lt;/div&gt;&lt;pre&gt;        $from = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateModels(
            Doctrine_Manager::getInstance()-&amp;gt;getAttribute(Doctrine_Core::ATTR_MODEL_CLASS_PREFIX) . self::$_fromPrefix,
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_from);
        $to = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_generateModels(
            Doctrine_Manager::getInstance()-&amp;gt;getAttribute(Doctrine_Core::ATTR_MODEL_CLASS_PREFIX) . self::$_toPrefix,
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_to                
        );
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Since it seems that when presented with a folder of models _generateModels ignores the prefix anyway. However, I&apos;m not sure of other impacts possible as a result?&lt;/p&gt;</comment>
                    <comment id="14141" author="andrewcoulton" created="Sun, 29 Aug 2010 06:29:06 +0000"  >&lt;p&gt;I&apos;ve been using and testing the modified version above locally for some time and it seems to work as expected. Any chance of this making it into core? Otherwise, the migrations feature is completely unusable when working YAML-YAML and using model prefixes on the newly released 1.2.3&lt;/p&gt;</comment>
                    <comment id="14144" author="jwage" created="Sun, 29 Aug 2010 12:22:54 +0000"  >&lt;p&gt;Has anyone been able to produce this in a test case?&lt;/p&gt;</comment>
                    <comment id="14182" author="andrewcoulton" created="Mon, 30 Aug 2010 18:16:35 +0000"  >&lt;p&gt;I&apos;ve attached a diff file with the DC755TestCase and the required from and to YAML schema files to reproduce this bug. I wasn&apos;t sure whether you prefer like this or as a git commit?&lt;/p&gt;</comment>
                    <comment id="14183" author="andrewcoulton" created="Mon, 30 Aug 2010 18:24:52 +0000"  >&lt;p&gt;Also attached a diff file of my proposed change to Doctrine_Migration_Diff to resolve this, but as I say unsure if it has implications on other migration types.&lt;/p&gt;</comment>
                    <comment id="14550" author="andrewcoulton" created="Sun, 10 Oct 2010 18:51:58 +0000"  >&lt;p&gt;Fixed by &lt;a href=&quot;http://github.com/acoulton/doctrine1/tree/DC-755&quot; class=&quot;external-link&quot;&gt;http://github.com/acoulton/doctrine1/tree/DC-755&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10752" name="dc755TestCase.diff" size="3114" author="andrewcoulton" created="Mon, 30 Aug 2010 18:16:35 +0000" />
                    <attachment id="10753" name="fix755.diff" size="642" author="andrewcoulton" created="Mon, 30 Aug 2010 18:24:52 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>