<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Managing Rails migrations</title>
	<atom:link href="http://rc3.org/2006/07/28/managing-rails-migrations/feed/" rel="self" type="application/rss+xml" />
	<link>http://rc3.org/2006/07/28/managing-rails-migrations/</link>
	<description>Strong opinions weakly held</description>
	<lastBuildDate>Fri, 10 Feb 2012 14:59:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Heath Raftery</title>
		<link>http://rc3.org/2006/07/28/managing-rails-migrations/comment-page-1/#comment-4801</link>
		<dc:creator>Heath Raftery</dc:creator>
		<pubDate>Sun, 01 Mar 2009 03:03:55 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/wordpress/?p=7472#comment-4801</guid>
		<description>&lt;p&gt;Did you ever find a good solution for this? I couldn&#039;t find any automated method, so came up with this procedure:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;rake db:schema:dump&lt;/li&gt;
&lt;li&gt;rake db:data:dump (requires yaml_db plugin I believe)&lt;/li&gt;
&lt;li&gt;script/generate migration create_schema&lt;/li&gt;
&lt;li&gt;copy contents of db/schema.rb into db/migrate/create_schema, editing as necessary (eg. reorder fields, remove :force option, add t.timestamps, change strings to symbols, create drop_table&#039;s for self.down)&lt;/li&gt;
&lt;li&gt;delete each of the migrations before the newly created one&lt;/li&gt;
&lt;li&gt;rake db:drop&lt;/li&gt;
&lt;li&gt;rake db:migrate&lt;/li&gt;
&lt;li&gt;rake db:data:load&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now the database is up to date and all the migrations have been rolled into one.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Did you ever find a good solution for this? I couldn&#8217;t find any automated method, so came up with this procedure:</p>

<ol>
<li>rake db:schema:dump</li>
<li>rake db:data:dump (requires yaml_db plugin I believe)</li>
<li>script/generate migration create_schema</li>
<li>copy contents of db/schema.rb into db/migrate/create_schema, editing as necessary (eg. reorder fields, remove :force option, add t.timestamps, change strings to symbols, create drop_table&#8217;s for self.down)</li>
<li>delete each of the migrations before the newly created one</li>
<li>rake db:drop</li>
<li>rake db:migrate</li>
<li>rake db:data:load</li>
</ol>

<p>Now the database is up to date and all the migrations have been rolled into one.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Mathews</title>
		<link>http://rc3.org/2006/07/28/managing-rails-migrations/comment-page-1/#comment-1052</link>
		<dc:creator>Dave Mathews</dc:creator>
		<pubDate>Fri, 30 Nov 2007 20:56:50 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/wordpress/?p=7472#comment-1052</guid>
		<description>&lt;p&gt;Here is a really, really useful (and pretty!) Rails Migrations cheatsheet in printable PDF format: &lt;a href=&quot;http://dizzy.co.uk/articles/rails-migrations&quot; rel=&quot;nofollow&quot;&gt;Rails Migrations cheatsheet&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Here is a really, really useful (and pretty!) Rails Migrations cheatsheet in printable PDF format: <a href="http://dizzy.co.uk/articles/rails-migrations" rel="nofollow">Rails Migrations cheatsheet</a></p>]]></content:encoded>
	</item>
	<item>
		<title>By: Rafe</title>
		<link>http://rc3.org/2006/07/28/managing-rails-migrations/comment-page-1/#comment-1051</link>
		<dc:creator>Rafe</dc:creator>
		<pubDate>Tue, 01 Aug 2006 04:45:02 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/wordpress/?p=7472#comment-1051</guid>
		<description>&lt;p&gt;Actually what I&#039;m talking about is something completely different -- Rails migrations, which let you version schema changes to a database.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Actually what I&#8217;m talking about is something completely different &#8212; Rails migrations, which let you version schema changes to a database.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: bryan</title>
		<link>http://rc3.org/2006/07/28/managing-rails-migrations/comment-page-1/#comment-1050</link>
		<dc:creator>bryan</dc:creator>
		<pubDate>Tue, 01 Aug 2006 03:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/wordpress/?p=7472#comment-1050</guid>
		<description>&lt;p&gt;We typically use branches for items that will break the trunk until they&#039;re fully implemented.  The rule is the trunk can never break - it must always compile and be functional.&lt;/p&gt;

&lt;p&gt;Small changes are made to the trunk, but larger changes are branched, and then remerged when complete.&lt;/p&gt;

&lt;p&gt;If I understand you correctly, Developer A is working on the trunk and B is working on a branch. They both make changes and you want to know how to incorporate them cleanly.&lt;/p&gt;

&lt;p&gt;When B is ready to move her branch back to the trunk, she first does a refresh from the trunk to ensure that anything new is now in her branch. She tests and verifies that everything works, then merges the branch into the trunk (probably testing a final time).&lt;/p&gt;

&lt;p&gt;Meanwhile, A is working on the trunk, so just before he commits, he does a refresh; all the new stuff that B added is then added to his local copy. He runs his tests and when they come out clean, he commits.&lt;/p&gt;

&lt;p&gt;If I recall correctly, if A tries to commit without refreshing, subversion will give a warning that his copy is not up to date and then fail the commit, preventing accedental overwriting of changed objects. I haven&#039;t run into this in a long time because my projects for the last few years have consisted of a development team of 1 (me). :P&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>We typically use branches for items that will break the trunk until they&#8217;re fully implemented.  The rule is the trunk can never break &#8211; it must always compile and be functional.</p>

<p>Small changes are made to the trunk, but larger changes are branched, and then remerged when complete.</p>

<p>If I understand you correctly, Developer A is working on the trunk and B is working on a branch. They both make changes and you want to know how to incorporate them cleanly.</p>

<p>When B is ready to move her branch back to the trunk, she first does a refresh from the trunk to ensure that anything new is now in her branch. She tests and verifies that everything works, then merges the branch into the trunk (probably testing a final time).</p>

<p>Meanwhile, A is working on the trunk, so just before he commits, he does a refresh; all the new stuff that B added is then added to his local copy. He runs his tests and when they come out clean, he commits.</p>

<p>If I recall correctly, if A tries to commit without refreshing, subversion will give a warning that his copy is not up to date and then fail the commit, preventing accedental overwriting of changed objects. I haven&#8217;t run into this in a long time because my projects for the last few years have consisted of a development team of 1 (me). <img src='http://rc3.org/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>]]></content:encoded>
	</item>
	<item>
		<title>By: Rafe</title>
		<link>http://rc3.org/2006/07/28/managing-rails-migrations/comment-page-1/#comment-1049</link>
		<dc:creator>Rafe</dc:creator>
		<pubDate>Mon, 31 Jul 2006 17:32:23 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/wordpress/?p=7472#comment-1049</guid>
		<description>&lt;p&gt;Branching and merging only complicate the problems with migrations.  What happens when I make migration #9 in the trunk and you make migration #9 in the development branch?  How do we merge the two cleanly?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Branching and merging only complicate the problems with migrations.  What happens when I make migration #9 in the trunk and you make migration #9 in the development branch?  How do we merge the two cleanly?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Bryan</title>
		<link>http://rc3.org/2006/07/28/managing-rails-migrations/comment-page-1/#comment-1048</link>
		<dc:creator>Bryan</dc:creator>
		<pubDate>Mon, 31 Jul 2006 17:00:44 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/wordpress/?p=7472#comment-1048</guid>
		<description>&lt;p&gt;Why not use the suggested subversion branch/tag/trunk directory tree?&lt;/p&gt;

&lt;pre&gt;
\myapp
+-\trunk
+-\branch
&#124;   +-\b01
&#124;   +-\b02
&#124;   +-...
+-\tag
+-\v-2.1
+-\v-2.3
+-\v-2.5
+-...
&lt;/pre&gt;

&lt;p&gt;So, all main development goes on in the trunk, and the past releases are maintained under their own directories. Any global updates are merged across versions + trunk.&lt;/p&gt;

&lt;p&gt;See &lt;strong&gt;Branching and Merging&lt;/strong&gt; in the &lt;a href=&quot;http://svnbook.red-bean.com/&quot; rel=&quot;nofollow&quot;&gt;subversion book&lt;/a&gt; (pp 61-85 in Svn 1.2 rev 2147) for details.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Why not use the suggested subversion branch/tag/trunk directory tree?</p>

<pre>
\myapp
+-\trunk
+-\branch
|   +-\b01
|   +-\b02
|   +-...
+-\tag
+-\v-2.1
+-\v-2.3
+-\v-2.5
+-...
</pre>

<p>So, all main development goes on in the trunk, and the past releases are maintained under their own directories. Any global updates are merged across versions + trunk.</p>

<p>See <strong>Branching and Merging</strong> in the <a href="http://svnbook.red-bean.com/" rel="nofollow">subversion book</a> (pp 61-85 in Svn 1.2 rev 2147) for details.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: paulrobinson.net</title>
		<link>http://rc3.org/2006/07/28/managing-rails-migrations/comment-page-1/#comment-1053</link>
		<dc:creator>paulrobinson.net</dc:creator>
		<pubDate>Mon, 31 Jul 2006 03:54:28 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/wordpress/?p=7472#comment-1053</guid>
		<description>&lt;p&gt;&lt;strong&gt;Rails Migrations Gone Wild&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Rafe Colburn wonders when you should clean up your Rails migrations: The question becomes, when do you delete all of your migrations and start over with a fresh schema? It seems to me that eventually it comes time to create a fresh database, run all of yo&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p><strong>Rails Migrations Gone Wild</strong></p>

<p>Rafe Colburn wonders when you should clean up your Rails migrations: The question becomes, when do you delete all of your migrations and start over with a fresh schema? It seems to me that eventually it comes time to create a fresh database, run all of yo</p>]]></content:encoded>
	</item>
</channel>
</rss>

