<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sat May 25 04:28:39 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-702/DC-702.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-702] Migration commands always want to drop all database tables</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-702</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;m trying to get migrations going, such that I install the database, make a change to the schema.yml (something simple such as a column length change), and then have a migration generated and performed.&lt;/p&gt;

&lt;p&gt;No matter what I try, doctrine just generates an initial add all the database tables, then after that if I try any further migration generation, they all try to drop all the database tables. I am not having much luck.&lt;/p&gt;



&lt;p&gt;$ rm ../application/data/migrations/*&lt;/p&gt;

&lt;p&gt;$ php ./doctrine build-all-reload&lt;br/&gt;
build-all-reload - Are you sure you wish to drop your databases? (y/n)&lt;br/&gt;
y&lt;br/&gt;
build-all-reload - Successfully dropped database for connection named &apos;0&apos;&lt;br/&gt;
build-all-reload - Generated models successfully from YAML schema&lt;br/&gt;
build-all-reload - Successfully created database for connection named &apos;0&apos;&lt;br/&gt;
build-all-reload - Created tables successfully&lt;br/&gt;
build-all-reload - Data was successfully loaded&lt;/p&gt;

&lt;p&gt;$ ls ../application/data/migrations&lt;/p&gt;

&lt;p&gt;$ php ./doctrine generate-migrations-db&lt;br/&gt;
generate-migrations-db - Generated migration classes successfully from database&lt;/p&gt;

&lt;p&gt;$ ls ../application/data/migrations&lt;br/&gt;
1274778030_addbal_file.php		1274778038_addbal_roleanduser.php	1274778046_addburn_fileandproject.php	1274778054_addinvoicedatabackup.php	1274778062_addburnprojectindex.php&lt;br/&gt;
1274778031_addbal_invoice.php		1274778039_addbal_user.php		1274778047_addburn_imageandproject.php	1274778055_addusergroup.php		1274778063_addideaindex.php&lt;br/&gt;
1274778032_addbal_invoiceitem.php	1274778040_addbrief.php			1274778048_addburn_project.php		1274778056_addusergroupanduserfor.php	1274778064_addusergroupindex.php&lt;br/&gt;
1274778033_addbal_message.php		1274778041_addbriefandfile.php		1274778049_addburn_recommendation.php	1274778057_addbalfileindex.php		1274778065_addfks.php&lt;br/&gt;
1274778034_addbal_permission.php	1274778042_addbriefanduserfor.php	1274778050_addburn_state.php		1274778058_addbalusertaggabletag.php&lt;br/&gt;
1274778035_addbal_permissionandrole.php	1274778043_addbrieftype.php		1274778051_addburn_suburb.php		1274778059_addtaggabletag.php&lt;br/&gt;
1274778036_addbal_permissionanduser.php	1274778044_addburn_company.php		1274778052_addidea.php			1274778060_addbriefindex.php&lt;br/&gt;
1274778037_addbal_role.php		1274778045_addburn_department.php	1274778053_addideaandimage.php		1274778061_addburncompanyindex.php&lt;/p&gt;

&lt;p&gt;$ ... make a change to the schema.yml file in my text editor and save, in this case change a column length from 250 to 200 ...&lt;/p&gt;

&lt;p&gt;$ php ./doctrine generate-migrations-diff&lt;br/&gt;
generate-migrations-diff - Generated migration classes successfully from difference&lt;/p&gt;

&lt;p&gt;$ ls ../application/data/migrations&lt;br/&gt;
1274778030_addbal_file.php		1274778038_addbal_roleanduser.php	1274778046_addburn_fileandproject.php	1274778054_addinvoicedatabackup.php	1274778062_addburnprojectindex.php&lt;br/&gt;
1274778031_addbal_invoice.php		1274778039_addbal_user.php		1274778047_addburn_imageandproject.php	1274778055_addusergroup.php		1274778063_addideaindex.php&lt;br/&gt;
1274778032_addbal_invoiceitem.php	1274778040_addbrief.php			1274778048_addburn_project.php		1274778056_addusergroupanduserfor.php	1274778064_addusergroupindex.php&lt;br/&gt;
1274778033_addbal_message.php		1274778041_addbriefandfile.php		1274778049_addburn_recommendation.php	1274778057_addbalfileindex.php		1274778065_addfks.php&lt;br/&gt;
1274778034_addbal_permission.php	1274778042_addbriefanduserfor.php	1274778050_addburn_state.php		1274778058_addbalusertaggabletag.php	1274778089_version37.php&lt;br/&gt;
1274778035_addbal_permissionandrole.php	1274778043_addbrieftype.php		1274778051_addburn_suburb.php		1274778059_addtaggabletag.php&lt;br/&gt;
1274778036_addbal_permissionanduser.php	1274778044_addburn_company.php		1274778052_addidea.php			1274778060_addbriefindex.php&lt;br/&gt;
1274778037_addbal_role.php		1274778045_addburn_department.php	1274778053_addideaandimage.php		1274778061_addburncompanyindex.php&lt;/p&gt;

&lt;p&gt;$ cat ../application/data/migrations/1274778089_version37.php &lt;br/&gt;
&amp;lt;?php&lt;br/&gt;
/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;This class has been auto-generated by the Doctrine ORM Framework&lt;br/&gt;
 */&lt;br/&gt;
class Version37 extends Doctrine_Migration_Base&lt;br/&gt;
{&lt;br/&gt;
    public function up()
    {
        $this-&amp;gt;dropTable(&apos;bal__file&apos;);
        $this-&amp;gt;dropTable(&apos;bal__invoice&apos;);
        $this-&amp;gt;dropTable(&apos;bal__invoice_item&apos;);
        $this-&amp;gt;dropTable(&apos;bal__message&apos;);
        $this-&amp;gt;dropTable(&apos;bal__permission&apos;);
        $this-&amp;gt;dropTable(&apos;bal__permission_and_role&apos;);
        $this-&amp;gt;dropTable(&apos;bal__permission_and_user&apos;);
        $this-&amp;gt;dropTable(&apos;bal__role&apos;);
        $this-&amp;gt;dropTable(&apos;bal__role_and_user&apos;);
        $this-&amp;gt;dropTable(&apos;bal__user&apos;);
        $this-&amp;gt;dropTable(&apos;brief&apos;);
        $this-&amp;gt;dropTable(&apos;brief_and_file&apos;);
        $this-&amp;gt;dropTable(&apos;brief_and_user_for&apos;);
        $this-&amp;gt;dropTable(&apos;brief_type&apos;);
        $this-&amp;gt;dropTable(&apos;burn__company&apos;);
        $this-&amp;gt;dropTable(&apos;burn__department&apos;);
        $this-&amp;gt;dropTable(&apos;burn__file_and_project&apos;);
        $this-&amp;gt;dropTable(&apos;burn__image_and_project&apos;);
        $this-&amp;gt;dropTable(&apos;burn__project&apos;);
        $this-&amp;gt;dropTable(&apos;burn__recommendation&apos;);
        $this-&amp;gt;dropTable(&apos;burn__state&apos;);
        $this-&amp;gt;dropTable(&apos;burn__suburb&apos;);
        $this-&amp;gt;dropTable(&apos;idea&apos;);
        $this-&amp;gt;dropTable(&apos;idea_and_image&apos;);
        $this-&amp;gt;dropTable(&apos;invoice_data_backup&apos;);
        $this-&amp;gt;dropTable(&apos;user_group&apos;);
        $this-&amp;gt;dropTable(&apos;user_group_and_user_for&apos;);
        $this-&amp;gt;dropTable(&apos;bal_file_index&apos;);
        $this-&amp;gt;dropTable(&apos;bal_user_taggable_tag&apos;);
        $this-&amp;gt;dropTable(&apos;taggable_tag&apos;);
        $this-&amp;gt;dropTable(&apos;brief_index&apos;);
        $this-&amp;gt;dropTable(&apos;burn_company_index&apos;);
        $this-&amp;gt;dropTable(&apos;burn_project_index&apos;);
        $this-&amp;gt;dropTable(&apos;burn_user_taggable_tag&apos;);
        $this-&amp;gt;dropTable(&apos;burn_user_index&apos;);
        $this-&amp;gt;dropTable(&apos;buyer_taggable_tag&apos;);
        $this-&amp;gt;dropTable(&apos;buyer_index&apos;);
        $this-&amp;gt;dropTable(&apos;company_index&apos;);
        $this-&amp;gt;dropTable(&apos;file_index&apos;);
        $this-&amp;gt;dropTable(&apos;idea_index&apos;);
        $this-&amp;gt;dropTable(&apos;project_index&apos;);
        $this-&amp;gt;dropTable(&apos;seller_taggable_tag&apos;);
        $this-&amp;gt;dropTable(&apos;seller_index&apos;);
        $this-&amp;gt;dropTable(&apos;user_taggable_tag&apos;);
        $this-&amp;gt;dropTable(&apos;user_index&apos;);
        $this-&amp;gt;dropTable(&apos;user_group_index&apos;);
    }&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;    public function down()&lt;br/&gt;
    {&lt;br/&gt;
        $this-&amp;gt;createTable(&apos;bal__file&apos;, array(&lt;br/&gt;
             &apos;id&apos; =&amp;gt; &lt;br/&gt;
             array(&lt;br/&gt;
....&lt;/p&gt;</description>
                <environment>Zend Server 5.0.1 for OSX, PHP 5.3.2, MySQL 5.1.43</environment>
            <key id="11411">DC-702</key>
            <summary>Migration commands always want to drop all database tables</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="5">Cannot Reproduce</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="balupton">Benjamin Arthur Lupton</reporter>
                        <labels>
                    </labels>
                <created>Tue, 25 May 2010 05:06:48 +0000</created>
                <updated>Mon, 7 May 2012 16:41:47 +0000</updated>
                    <resolved>Tue, 8 Jun 2010 10:25:10 +0000</resolved>
                            <version>1.2.2</version>
                                                <component>Migrations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="13056" author="balupton" created="Tue, 25 May 2010 05:08:16 +0000"  >&lt;p&gt;Clarity over tables and database.&lt;/p&gt;</comment>
                    <comment id="13057" author="balupton" created="Tue, 25 May 2010 05:18:42 +0000"  >&lt;p&gt;forgot to add the part about me changing the yaml file inbetween&lt;/p&gt;</comment>
                    <comment id="13152" author="jwage" created="Tue, 8 Jun 2010 10:25:10 +0000"  >&lt;p&gt;Hi, I cannot reproduce the issue unfortunately &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;&lt;/p&gt;</comment>
                    <comment id="14841" author="skaverat" created="Fri, 26 Nov 2010 06:08:35 +0000"  >&lt;p&gt;I have the exact same problem.&lt;/p&gt;

&lt;p&gt;Looking at the paths, is seems OP uses the same ZendCasts.com setup for ZendFramework/Doctrine. I think the problem lies somewhere in there. Anyone got an idea?&lt;/p&gt;</comment>
                    <comment id="14842" author="skaverat" created="Fri, 26 Nov 2010 08:41:05 +0000"  >&lt;p&gt;Okay, found the problem, And I really hope there will be a fix soon, because it one of the biggest features of doctrine:&lt;/p&gt;

&lt;p&gt;To get autoloading in ZendFramework correct, Doctrine has to prefix all models with &quot;Model_&quot; (see &lt;a href=&quot;http://www.zendcasts.com/deep-integration-between-zend-and-doctrine-1-2/2010/01/&quot; class=&quot;external-link&quot;&gt;http://www.zendcasts.com/deep-integration-between-zend-and-doctrine-1-2/2010/01/&lt;/a&gt; for more information)&lt;br/&gt;
The problem is, that the Diff-generating script searches for i.e. the class &quot;User&quot; instead of &quot;Model_User&quot;, thinks that it doesnt exist, and wants to recreate it from scratch&lt;/p&gt;</comment>
                    <comment id="17933" author="tingham" created="Mon, 7 May 2012 16:41:47 +0000"  >&lt;p&gt;We&apos;re having this same issue in 1.2.3 right now. Has anyone found a workaround? It seems likely that given the age of the last comment - I&apos;m out of luck but yolo.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>