Created
October 21, 2014 18:27
-
-
Save jrhorn424/2f9580290abe34603cf9 to your computer and use it in GitHub Desktop.
Simply drop your database and start again
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/tasks/db.rake | |
# execute me with rake db:nuke_pave | |
namespace :db do | |
desc "drops, creates, migrates, and seeds database" | |
unless Rails.env == "Production" | |
task :nuke_pave => %w(environment db:drop db:create db:migrate db:seed) do | |
# If you have a sample file that creates data for you to play with locally: | |
# Rake::Task["db:sample"].execute if Rails.env == "development" | |
puts "Nuke and pave of #{Rails.env} complete." | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks Jeff!