<?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: Making Rails&#8217; rake:test not drop your PGSQL database</title>
	<atom:link href="http://www.pervasivecode.com/blog/2007/09/22/making-rails-raketest-not-drop-your-pgsql-database/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pervasivecode.com/blog/2007/09/22/making-rails-raketest-not-drop-your-pgsql-database/</link>
	<description>Jamie Flournoy's Software Development Blog</description>
	<lastBuildDate>Wed, 02 Nov 2011 15:50:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: ZaiZi</title>
		<link>http://www.pervasivecode.com/blog/2007/09/22/making-rails-raketest-not-drop-your-pgsql-database/comment-page-1/#comment-21148</link>
		<dc:creator>ZaiZi</dc:creator>
		<pubDate>Thu, 10 Sep 2009 13:59:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.pervasivecode.com/blog/2007/09/22/making-rails-raketest-not-drop-your-pgsql-database/#comment-21148</guid>
		<description>Hi,
I really need help man,Actually i was looking for something as u mentioned above.My problem is that i am using a postgresql function for calculating distance between points.I have put the creation of this function in Migration file.But when ever i run Rake test,it simple drop my function. :(-.I don&#039;t know how to solve this.I follow ur above method but it is dropping my all tables and i got a lot of errors.Any help?</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I really need help man,Actually i was looking for something as u mentioned above.My problem is that i am using a postgresql function for calculating distance between points.I have put the creation of this function in Migration file.But when ever i run Rake test,it simple drop my function. :(-.I don&#8217;t know how to solve this.I follow ur above method but it is dropping my all tables and i got a lot of errors.Any help?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sbl</title>
		<link>http://www.pervasivecode.com/blog/2007/09/22/making-rails-raketest-not-drop-your-pgsql-database/comment-page-1/#comment-5472</link>
		<dc:creator>sbl</dc:creator>
		<pubDate>Thu, 27 Mar 2008 14:53:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.pervasivecode.com/blog/2007/09/22/making-rails-raketest-not-drop-your-pgsql-database/#comment-5472</guid>
		<description>Hello, previous version has some problems with rails 2.0.2. Following code seems to be working correctly.

&lt;pre&gt;
Rake::TaskManager.class_eval do
  def delete_task(task_name)
    @tasks.delete(task_name.to_s)
  end
  Rake.application.delete_task(&quot;db:test:purge&quot;)
  Rake.application.delete_task(&quot;db:test:prepare&quot;)
end

namespace :db do
  namespace :test do
    task :purge =&gt; [:environment] do
      
      ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations[&#039;test&#039;])
      ActiveRecord::Migrator.migrate(&quot;db/migrate/&quot;, 0)
      
      
    end
    
    task :prepare =&gt; [:environment, :purge] do 
      ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations[&#039;test&#039;])
      ActiveRecord::Migration.verbose = false
      ActiveRecord::Migrator.migrate(&quot;db/migrate/&quot;)
    end
  end
end
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hello, previous version has some problems with rails 2.0.2. Following code seems to be working correctly.</p>
<pre>
Rake::TaskManager.class_eval do
  def delete_task(task_name)
    @tasks.delete(task_name.to_s)
  end
  Rake.application.delete_task("db:test:purge")
  Rake.application.delete_task("db:test:prepare")
end

namespace :db do
  namespace :test do
    task :purge =&gt; [:environment] do

      ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations['test'])
      ActiveRecord::Migrator.migrate("db/migrate/", 0)

    end

    task :prepare =&gt; [:environment, :purge] do
      ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations['test'])
      ActiveRecord::Migration.verbose = false
      ActiveRecord::Migrator.migrate("db/migrate/")
    end
  end
end
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: guilhem</title>
		<link>http://www.pervasivecode.com/blog/2007/09/22/making-rails-raketest-not-drop-your-pgsql-database/comment-page-1/#comment-4725</link>
		<dc:creator>guilhem</dc:creator>
		<pubDate>Mon, 25 Feb 2008 23:59:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.pervasivecode.com/blog/2007/09/22/making-rails-raketest-not-drop-your-pgsql-database/#comment-4725</guid>
		<description>great code sample. thanks! I don&#039;t know if it comes from upgrading to rails 2 but I actually had to add : ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations[&#039;test&#039;])
before the ActiveRecord::Migrator... or the reverse migration was applied to the development database instead of the test db. Anyway it helped.</description>
		<content:encoded><![CDATA[<p>great code sample. thanks! I don&#8217;t know if it comes from upgrading to rails 2 but I actually had to add : ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations['test'])<br />
before the ActiveRecord::Migrator&#8230; or the reverse migration was applied to the development database instead of the test db. Anyway it helped.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

