Skip to content

Instantly share code, notes, and snippets.

@charlieok
charlieok / db_rollback_to_common.rake
Created April 5, 2009 21:27 — forked from outoftime/db_rollback_to_common.rake
I basically just added an if-else block here so it won't throw an error if there are no migration differences
#
# Usage:
# rake db:rollback_to_common branch=production
# git checkout -m production
# rake db:migrate
#
namespace :db do
desc 'Rolls back database to common migration state between current branch and another'
task :rollback_to_common do
FileUtils.cd(RAILS_ROOT) do