Skip to content

Instantly share code, notes, and snippets.

@blatyo
Created February 27, 2013 12:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blatyo/5047690 to your computer and use it in GitHub Desktop.
Save blatyo/5047690 to your computer and use it in GitHub Desktop.
Just creates a rake task that does the same as `db:migrate` for a different directory. Uses the same schema migrations table that migrations use. We don't migrate down for iterations.
namespace :iteration do
desc "Runs the tasks for the current iteration"
task :current => 'iteration:migrate'
desc 'Runs the unrun iteration tasks'
task :migrate => :environment do
mig = ActiveRecord::Migrator.new(:up, File.join(Rails.root, 'db', 'iterations'))
mig.migrate
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment