added rake task to clear and re-seed the database on schedule
This commit is contained in:
17
lib/tasks/reset.rake
Normal file
17
lib/tasks/reset.rake
Normal 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
|
||||
Reference in New Issue
Block a user