#!/usr/bin/env rake # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. require File.expand_path('../config/application', __FILE__) Server::Application.load_tasks # http://www.pervasivecode.com/blog/2007/09/22/making-rails-raketest-not-drop-your-pgsql-database/ # # don't drop the test database; migrate it back to 0 Rake::TaskManager.class_eval do def delete_task(task_name) @tasks.delete(task_name.to_s) end Rake.application.delete_task("db:test:purge") end namespace :db do namespace :test do task :purge do ActiveRecord::Migrator.migrate("db/migrate/", 0) end end end