<?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: Resolved: Should schema.rb be included in your source control?</title>
	<atom:link href="http://pathfindersoftware.com/2008/07/resolved-should-schemarb-be-included-in-your-source-control/feed/" rel="self" type="application/rss+xml" />
	<link>http://pathfindersoftware.com/2008/07/resolved-should-schemarb-be-included-in-your-source-control/</link>
	<description>The Fastest Way to Launch Successful Software</description>
	<lastBuildDate>Thu, 19 Jan 2012 16:36:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Dumping and restoring data with the YamlDB gem &#171; Silence is Foo</title>
		<link>http://pathfindersoftware.com/2008/07/resolved-should-schemarb-be-included-in-your-source-control/#comment-8519</link>
		<dc:creator>Dumping and restoring data with the YamlDB gem &#171; Silence is Foo</dc:creator>
		<pubDate>Mon, 19 Jul 2010 20:05:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1046#comment-8519</guid>
		<description>[...] and restoring data in YAML format. It complements the database-independent schema format found in db/schema.rb. The data is saved into [...]</description>
		<content:encoded><![CDATA[<p>[...] and restoring data in YAML format. It complements the database-independent schema format found in db/schema.rb. The data is saved into [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 室內設計</title>
		<link>http://pathfindersoftware.com/2008/07/resolved-should-schemarb-be-included-in-your-source-control/#comment-8518</link>
		<dc:creator>室內設計</dc:creator>
		<pubDate>Wed, 03 Dec 2008 10:46:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1046#comment-8518</guid>
		<description>We needed this because we do a lot of our experimental development in branches and therefore development database can contain things you don’t want to make their way to production right away.</description>
		<content:encoded><![CDATA[<p>We needed this because we do a lot of our experimental development in branches and therefore development database can contain things you don’t want to make their way to production right away.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lar Van Der Jagt</title>
		<link>http://pathfindersoftware.com/2008/07/resolved-should-schemarb-be-included-in-your-source-control/#comment-8517</link>
		<dc:creator>Lar Van Der Jagt</dc:creator>
		<pubDate>Sat, 06 Sep 2008 17:21:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1046#comment-8517</guid>
		<description>In the early stages of development while things are still fairly volatile I like to be able to blow out and rebuild my database on demand. Until the app goes into production I usually give each model it&#039;s own migration and just update that as the schema evolves, dropping &amp; recreating the db as I go.

I use Michael Bleigh&#039;s seed_fu to manage my seed data (can be found on github). True I need to keep seed data in synch with schema changes, but unlike using fixtures for this purpose the seed data comes from ruby scripts so you can get around the more common issues with careful scripting.

Of course this strategy won&#039;t work for production, once I&#039;ve got some more experience deploying my own apps I may have to reassess this method.</description>
		<content:encoded><![CDATA[<p>In the early stages of development while things are still fairly volatile I like to be able to blow out and rebuild my database on demand. Until the app goes into production I usually give each model it&#8217;s own migration and just update that as the schema evolves, dropping &amp; recreating the db as I go.</p>
<p>I use Michael Bleigh&#8217;s seed_fu to manage my seed data (can be found on github). True I need to keep seed data in synch with schema changes, but unlike using fixtures for this purpose the seed data comes from ruby scripts so you can get around the more common issues with careful scripting.</p>
<p>Of course this strategy won&#8217;t work for production, once I&#8217;ve got some more experience deploying my own apps I may have to reassess this method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Antares Traders Blog » The schema.rb Source Control Debate</title>
		<link>http://pathfindersoftware.com/2008/07/resolved-should-schemarb-be-included-in-your-source-control/#comment-8516</link>
		<dc:creator>Antares Traders Blog » The schema.rb Source Control Debate</dc:creator>
		<pubDate>Wed, 23 Jul 2008 19:40:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1046#comment-8516</guid>
		<description>[...] Rappin has written a post at Pathfinder about whether or not schema.rb belongs in source control.  I&#8217;m going to put my two cents in and say it does.  The debate centers on the role of [...]</description>
		<content:encoded><![CDATA[<p>[...] Rappin has written a post at Pathfinder about whether or not schema.rb belongs in source control.  I&#8217;m going to put my two cents in and say it does.  The debate centers on the role of [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anthony Caliendo</title>
		<link>http://pathfindersoftware.com/2008/07/resolved-should-schemarb-be-included-in-your-source-control/#comment-8515</link>
		<dc:creator>Anthony Caliendo</dc:creator>
		<pubDate>Mon, 21 Jul 2008 22:29:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1046#comment-8515</guid>
		<description>For those of you who mention that your migrations will fail after modifying the model/removing models, I have two comments:

1) In order to maintain that your migrations work with a clean DB, you can setup cruise to always start with a clean DB.  I always configure cruise to run &quot;rake db:migrate:reset&quot; before it runs the tests.  If the migrations have been broken, cruise breaks and you can fix the migrations.

2) I do not think that you should be doing any sort of manipulation in the migrations which would break if the model changes.  That means that loading fixtures or what-not in the migration should be avoided; the only data manipulation should be when you need to massage data to fit into the new schema (i.e. migrating existing data in your DB to fit the new schema).  Make sure that your &#039;down&#039; does this migration in reverse!  If you really need to load up fixtures or something outside of pure data migration (loading up default values is NOT data migration!), then create separate rake tasks to do this.  You can then customize your build to run these rake tasks as needed.

I&#039;ve seen far too many migrations break because there wasn&#039;t proper separation of concerns in the migrations.</description>
		<content:encoded><![CDATA[<p>For those of you who mention that your migrations will fail after modifying the model/removing models, I have two comments:</p>
<p>1) In order to maintain that your migrations work with a clean DB, you can setup cruise to always start with a clean DB.  I always configure cruise to run &#8220;rake db:migrate:reset&#8221; before it runs the tests.  If the migrations have been broken, cruise breaks and you can fix the migrations.</p>
<p>2) I do not think that you should be doing any sort of manipulation in the migrations which would break if the model changes.  That means that loading fixtures or what-not in the migration should be avoided; the only data manipulation should be when you need to massage data to fit into the new schema (i.e. migrating existing data in your DB to fit the new schema).  Make sure that your &#8216;down&#8217; does this migration in reverse!  If you really need to load up fixtures or something outside of pure data migration (loading up default values is NOT data migration!), then create separate rake tasks to do this.  You can then customize your build to run these rake tasks as needed.</p>
<p>I&#8217;ve seen far too many migrations break because there wasn&#8217;t proper separation of concerns in the migrations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://pathfindersoftware.com/2008/07/resolved-should-schemarb-be-included-in-your-source-control/#comment-8514</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Mon, 21 Jul 2008 15:20:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1046#comment-8514</guid>
		<description>I consider the db/schema.rb to be the the official database structure, however, I also verify that my migrations can execute properly with an empty database. It is not that difficult to keep the migrations working even when removing models from your code.</description>
		<content:encoded><![CDATA[<p>I consider the db/schema.rb to be the the official database structure, however, I also verify that my migrations can execute properly with an empty database. It is not that difficult to keep the migrations working even when removing models from your code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xavier Shay</title>
		<link>http://pathfindersoftware.com/2008/07/resolved-should-schemarb-be-included-in-your-source-control/#comment-8513</link>
		<dc:creator>Xavier Shay</dc:creator>
		<pubDate>Mon, 21 Jul 2008 04:45:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1046#comment-8513</guid>
		<description>We do what Justin does - recreate from production DB.
Migrations aren&#039;t feasible to keep clean (or even restore from if they were) once you have 700 of them.
schema.rb would then seem appropriate, but
- it doesn&#039;t include static data (a separate rake task would need to be kept up to date for this)
- more often than not it results in conflicts. Ideally every developer should have exactly the same DB but in practice this does not work for us. Copying tables for back up purposes, quickly switching on to a branch with migrations, subtlely different encoding settings/MySQL revisions, etc.

For a long time we tried keeping schema.rb in source control, but we never once restored from it, and it was the #1 source of conflicts when commiting, so now we&#039;ve ignored it.</description>
		<content:encoded><![CDATA[<p>We do what Justin does &#8211; recreate from production DB.<br />
Migrations aren&#8217;t feasible to keep clean (or even restore from if they were) once you have 700 of them.<br />
schema.rb would then seem appropriate, but<br />
- it doesn&#8217;t include static data (a separate rake task would need to be kept up to date for this)<br />
- more often than not it results in conflicts. Ideally every developer should have exactly the same DB but in practice this does not work for us. Copying tables for back up purposes, quickly switching on to a branch with migrations, subtlely different encoding settings/MySQL revisions, etc.</p>
<p>For a long time we tried keeping schema.rb in source control, but we never once restored from it, and it was the #1 source of conflicts when commiting, so now we&#8217;ve ignored it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brennan</title>
		<link>http://pathfindersoftware.com/2008/07/resolved-should-schemarb-be-included-in-your-source-control/#comment-8512</link>
		<dc:creator>Brennan</dc:creator>
		<pubDate>Mon, 21 Jul 2008 00:32:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1046#comment-8512</guid>
		<description>I&#039;m a fan of auto-migrations. http://errtheblog.com/posts/65-automatically

As for being able to see the progression of the DB, isn&#039;t that what source control is for?</description>
		<content:encoded><![CDATA[<p>I&#8217;m a fan of auto-migrations. <a href="http://errtheblog.com/posts/65-automatically" rel="nofollow">http://errtheblog.com/posts/65-automatically</a></p>
<p>As for being able to see the progression of the DB, isn&#8217;t that what source control is for?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen Veit</title>
		<link>http://pathfindersoftware.com/2008/07/resolved-should-schemarb-be-included-in-your-source-control/#comment-8511</link>
		<dc:creator>Stephen Veit</dc:creator>
		<pubDate>Sun, 20 Jul 2008 13:31:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1046#comment-8511</guid>
		<description>@Darren: We never use an external model class from inside a migration because of the fact that it might go away. If we need to access a model, we define the model class inside of the migration class where is is used. This allows to always be able to run our migrations from scratch, even if an old model has gone away. I treat schema.rb as a generated file.</description>
		<content:encoded><![CDATA[<p>@Darren: We never use an external model class from inside a migration because of the fact that it might go away. If we need to access a model, we define the model class inside of the migration class where is is used. This allows to always be able to run our migrations from scratch, even if an old model has gone away. I treat schema.rb as a generated file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: darkstego</title>
		<link>http://pathfindersoftware.com/2008/07/resolved-should-schemarb-be-included-in-your-source-control/#comment-8510</link>
		<dc:creator>darkstego</dc:creator>
		<pubDate>Sat, 19 Jul 2008 20:40:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1046#comment-8510</guid>
		<description>One of the things that I found frustrating about rails is trying to get a good grasp of the database schema by figuring out multiple migration files. Which is why I found the plugin automigrations to be so useful.

I believe the incremental nature of migrations has some advantages but it kinda falls in an area of &quot;should be handled by SCM&quot;. Looking at increments makes it very difficult to grasp the whole picture, and as development grows a lot of defunct migrations get piled up which serve no purpose other than causing errors during migrations.

It would be interesting to see if one could come up with a solution that provided several of the advantages of migrations (data entry, raw SQL) into a solution that does not pile up incremental files.

Maybe if migrations could be flushed at certain stable points. And the schema.rb becomes a single migration file at that point.</description>
		<content:encoded><![CDATA[<p>One of the things that I found frustrating about rails is trying to get a good grasp of the database schema by figuring out multiple migration files. Which is why I found the plugin automigrations to be so useful.</p>
<p>I believe the incremental nature of migrations has some advantages but it kinda falls in an area of &#8220;should be handled by SCM&#8221;. Looking at increments makes it very difficult to grasp the whole picture, and as development grows a lot of defunct migrations get piled up which serve no purpose other than causing errors during migrations.</p>
<p>It would be interesting to see if one could come up with a solution that provided several of the advantages of migrations (data entry, raw SQL) into a solution that does not pile up incremental files.</p>
<p>Maybe if migrations could be flushed at certain stable points. And the schema.rb becomes a single migration file at that point.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (User agent is rejected)
Page Caching using memcached (User agent is rejected)

Served from: pathfindersoftware.com @ 2012-02-10 02:58:39 -->
