added rake task to clear and re-seed the database on schedule

This commit is contained in:
Mike Kelley
2011-12-28 15:38:08 -07:00
parent ffcb2bb0b9
commit 61c9ddf2c3
3 changed files with 19 additions and 2 deletions

17
lib/tasks/reset.rake Normal file
View File

@@ -0,0 +1,17 @@
namespace :community do
desc "clears the database"
task :reset do
if Rails.env == "production"
Rake::Task['pg:reset'].invoke
else
Rake::Task['db:migrate:reset'].invoke
end
end
desc "re-seed the database"
task :seed => :reset do
Rake::Task['db:seed'].invoke
end
end