Skip to content

Instantly share code, notes, and snippets.

@kangjoonsoo
Created May 29, 2013 12:49
Show Gist options
  • Select an option

  • Save kangjoonsoo/5670033 to your computer and use it in GitHub Desktop.

Select an option

Save kangjoonsoo/5670033 to your computer and use it in GitHub Desktop.
rake db:drop db:create db:migrate db:seed => rake db:rebuild
namespace :db do
desc "Drop, create, migrate then seed the database"
task :rebuild => :environment do
Rake::Task['db:drop'].invoke
Rake::Task['db:create'].invoke
Rake::Task['db:migrate'].invoke
Rake::Task['db:seed'].invoke
end
namespace :rebuild do
desc "Drop, create, migrate the database with RAILS_ENV=test"
task :test => :environment do
Rails.env = 'test'
Rake::Task['db:drop'].invoke
Rake::Task['db:create'].invoke
Rake::Task['db:migrate'].invoke
end
end
end
@kangjoonsoo
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment