Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Chris Wanstrath http://errtheblog.com

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

rake remigrate

From http://errtheblog.com/post/3
Drops your database, recreates it, runs all migrations, then loads fixtures. Heroic.

desc "Drop then recreate the dev database, migrate up, and load fixtures" 
task :remigrate => :environment do
  return unless %w[development test staging].include? RAILS_ENV
  ActiveRecord::Base.connection.tables.each { |t| ActiveRecord::Base.connection.drop_table t }
  Rake::Task[:migrate].invoke
  Rake::Task["db:fixtures:load"].invoke
end
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS