Skip to content

Instantly share code, notes, and snippets.

@christiannaths
Created March 17, 2013 21:47
Show Gist options
  • Save christiannaths/5183798 to your computer and use it in GitHub Desktop.
Save christiannaths/5183798 to your computer and use it in GitHub Desktop.
# Drops, re-creates and re-migrates the database
# Usage: rake db:remigrate
namespace :db do
desc "Raise an error unless development environment"
task :dev_only do
raise "You can only use this in dev!" unless Rails.env == 'development'
end
desc "Drop, create, migrate then seed the development database"
task remigrate: [
'environment',
'db:dev_only',
'db:drop',
'db:create',
'db:migrate'
]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment