<?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: Automatically Creating, Loading, and Migrating your Database (with&#160;magic!)</title>
	<atom:link href="http://almosteffortless.com/2008/04/10/automatically-creating-loading-and-migrating-your-database/feed/" rel="self" type="application/rss+xml" />
	<link>http://almosteffortless.com/2008/04/10/automatically-creating-loading-and-migrating-your-database/</link>
	<description></description>
	<lastBuildDate>Wed, 10 Mar 2010 01:15:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Josh Nichols</title>
		<link>http://almosteffortless.com/2008/04/10/automatically-creating-loading-and-migrating-your-database/comment-page-1/#comment-66402</link>
		<dc:creator>Josh Nichols</dc:creator>
		<pubDate>Fri, 02 May 2008 19:20:40 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=674#comment-66402</guid>
		<description>This seems like it&#039;d be extremely useful... in development.

For production, I think capistrano can nicely handle creating/migrating the database.</description>
		<content:encoded><![CDATA[<p>This seems like it&#8217;d be extremely useful&#8230; in development.</p>
<p>For production, I think capistrano can nicely handle creating/migrating the database.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2008-04-24 &#124; Libin Pan</title>
		<link>http://almosteffortless.com/2008/04/10/automatically-creating-loading-and-migrating-your-database/comment-page-1/#comment-66390</link>
		<dc:creator>links for 2008-04-24 &#124; Libin Pan</dc:creator>
		<pubDate>Thu, 24 Apr 2008 06:40:13 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=674#comment-66390</guid>
		<description>[...] almost effortless Â» Automatically Creating, Loading, and Migrating your Database (with magic!) Automatically Creating, Loading, and Migrating your Database (with magic!) (tags: activerecord database rails rubyonrails migrations rake ruby) [...]</description>
		<content:encoded><![CDATA[<p>[...] almost effortless Â» Automatically Creating, Loading, and Migrating your Database (with magic!) Automatically Creating, Loading, and Migrating your Database (with magic!) (tags: activerecord database rails rubyonrails migrations rake ruby) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Mathers</title>
		<link>http://almosteffortless.com/2008/04/10/automatically-creating-loading-and-migrating-your-database/comment-page-1/#comment-66359</link>
		<dc:creator>David Mathers</dc:creator>
		<pubDate>Sun, 13 Apr 2008 22:36:54 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=674#comment-66359</guid>
		<description>With MySQL you can use:

http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#function_get-lock</description>
		<content:encoded><![CDATA[<p>With MySQL you can use:</p>
<p><a href="http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#function_get-lock" rel="nofollow">http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#function_get-lock</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Al Brown</title>
		<link>http://almosteffortless.com/2008/04/10/automatically-creating-loading-and-migrating-your-database/comment-page-1/#comment-66349</link>
		<dc:creator>Al Brown</dc:creator>
		<pubDate>Sat, 12 Apr 2008 00:14:20 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=674#comment-66349</guid>
		<description>this seems dangerous

Wouldn&#039;t it be better if the code notified you (by emailing you a report or a URL for it) as to what changes it needs to make and give you the option of approving?  

In the mean time, your app can make people wait until the db version is correct.  

Starting your app could also display a message, but with everything automated, you won&#039;t see it.

I think its best that you avoid depending on this mechanism though.  Your best beat is to establish robust processes that check the db version and do the appropriate thing before restarting your app.  Yes, the above would be cooler of course, but looking goofy to your users just once because of it will wipe out any coolness upgrade it buys you.</description>
		<content:encoded><![CDATA[<p>this seems dangerous</p>
<p>Wouldn&#8217;t it be better if the code notified you (by emailing you a report or a URL for it) as to what changes it needs to make and give you the option of approving?  </p>
<p>In the mean time, your app can make people wait until the db version is correct.  </p>
<p>Starting your app could also display a message, but with everything automated, you won&#8217;t see it.</p>
<p>I think its best that you avoid depending on this mechanism though.  Your best beat is to establish robust processes that check the db version and do the appropriate thing before restarting your app.  Yes, the above would be cooler of course, but looking goofy to your users just once because of it will wipe out any coolness upgrade it buys you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Malcontent</title>
		<link>http://almosteffortless.com/2008/04/10/automatically-creating-loading-and-migrating-your-database/comment-page-1/#comment-66348</link>
		<dc:creator>Malcontent</dc:creator>
		<pubDate>Fri, 11 Apr 2008 22:53:47 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=674#comment-66348</guid>
		<description>Rake keeps the latest version in the database, why not do this...

check if the database exists, if not create it and migreate.

If the database exists see if the migration tables are there. If not migrate.

Check latest version from the database and migrate if needed.

Come to think of it why not migrate if the database exists? What&#039;s the harm in running the migration?</description>
		<content:encoded><![CDATA[<p>Rake keeps the latest version in the database, why not do this&#8230;</p>
<p>check if the database exists, if not create it and migreate.</p>
<p>If the database exists see if the migration tables are there. If not migrate.</p>
<p>Check latest version from the database and migrate if needed.</p>
<p>Come to think of it why not migrate if the database exists? What&#8217;s the harm in running the migration?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://almosteffortless.com/2008/04/10/automatically-creating-loading-and-migrating-your-database/comment-page-1/#comment-66347</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Fri, 11 Apr 2008 16:58:24 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=674#comment-66347</guid>
		<description>Michael, that&#039;s interesting. Maybe wrapping the entire thing in a transaction wouldn&#039;t be a bad idea. I don&#039;t see how it could hurt...</description>
		<content:encoded><![CDATA[<p>Michael, that&#8217;s interesting. Maybe wrapping the entire thing in a transaction wouldn&#8217;t be a bad idea. I don&#8217;t see how it could hurt&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Buckbee</title>
		<link>http://almosteffortless.com/2008/04/10/automatically-creating-loading-and-migrating-your-database/comment-page-1/#comment-66346</link>
		<dc:creator>Michael Buckbee</dc:creator>
		<pubDate>Fri, 11 Apr 2008 16:56:38 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=674#comment-66346</guid>
		<description>You could wrap the SQL in a transaction so that only the first mongrel (or whatever you happen to be using) got to it that it would already be taken care of. 

Even without that, you&#039;d still _probably_ be ok as the subsequent migrations would fail as soon as they hit something that already existed (like trying to add a column that was already there).</description>
		<content:encoded><![CDATA[<p>You could wrap the SQL in a transaction so that only the first mongrel (or whatever you happen to be using) got to it that it would already be taken care of. </p>
<p>Even without that, you&#8217;d still _probably_ be ok as the subsequent migrations would fail as soon as they hit something that already existed (like trying to add a column that was already there).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rodrigo Urubata</title>
		<link>http://almosteffortless.com/2008/04/10/automatically-creating-loading-and-migrating-your-database/comment-page-1/#comment-66345</link>
		<dc:creator>Rodrigo Urubata</dc:creator>
		<pubDate>Fri, 11 Apr 2008 16:24:09 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=674#comment-66345</guid>
		<description>there is no need to change it for timed migrations because the format used grants a higer number every time :D</description>
		<content:encoded><![CDATA[<p>there is no need to change it for timed migrations because the format used grants a higer number every time :D</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rodrigo Urubata</title>
		<link>http://almosteffortless.com/2008/04/10/automatically-creating-loading-and-migrating-your-database/comment-page-1/#comment-66344</link>
		<dc:creator>Rodrigo Urubata</dc:creator>
		<pubDate>Fri, 11 Apr 2008 16:22:59 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=674#comment-66344</guid>
		<description>Great idea :D
I liked this initializer :D</description>
		<content:encoded><![CDATA[<p>Great idea :D<br />
I liked this initializer :D</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://almosteffortless.com/2008/04/10/automatically-creating-loading-and-migrating-your-database/comment-page-1/#comment-66343</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Fri, 11 Apr 2008 15:15:50 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=674#comment-66343</guid>
		<description>Might have to change the regex if you&#039;re using UTC migrations? Maybe go with a time parse or something...

http://ryandaigle.com/articles/2008/4/2/what-s-new-in-edge-rails-utc-based-migration-versioning

Thanks for the Rake trick, btw!</description>
		<content:encoded><![CDATA[<p>Might have to change the regex if you&#8217;re using UTC migrations? Maybe go with a time parse or something&#8230;</p>
<p><a href="http://ryandaigle.com/articles/2008/4/2/what-s-new-in-edge-rails-utc-based-migration-versioning" rel="nofollow">http://ryandaigle.com/articles/2008/4/2/what-s-new-in-edge-rails-utc-based-migration-versioning</a></p>
<p>Thanks for the Rake trick, btw!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://almosteffortless.com/2008/04/10/automatically-creating-loading-and-migrating-your-database/comment-page-1/#comment-66342</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Fri, 11 Apr 2008 15:15:34 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=674#comment-66342</guid>
		<description>I don&#039;t know, actually - that&#039;s an interesting question. Maybe there&#039;s a way to lock the entire database or app so that no other requests would be processed at that time?</description>
		<content:encoded><![CDATA[<p>I don&#8217;t know, actually &#8211; that&#8217;s an interesting question. Maybe there&#8217;s a way to lock the entire database or app so that no other requests would be processed at that time?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://almosteffortless.com/2008/04/10/automatically-creating-loading-and-migrating-your-database/comment-page-1/#comment-66341</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Fri, 11 Apr 2008 12:27:06 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=674#comment-66341</guid>
		<description>Love the idea but potentially couldn&#039;t you get a race condition with multiple mongrels all trying to migrate the app at the same time? 

Don&#039;t know the internals of migrate tasks well enough to say for sure.</description>
		<content:encoded><![CDATA[<p>Love the idea but potentially couldn&#8217;t you get a race condition with multiple mongrels all trying to migrate the app at the same time? </p>
<p>Don&#8217;t know the internals of migrate tasks well enough to say for sure.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
