Added db:migrate:redo for rerunning existing migrations (closes #10431) [matt]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8382 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2007-12-14 17:47:56 +00:00
parent 9661395d38
commit 9187ed8656
3 changed files with 8 additions and 1 deletions

View File

@ -1,4 +1,4 @@
Copyright (c) 2005-2006 David Heinemeier Hansson
Copyright (c) 2005-2007 David Heinemeier Hansson
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

View File

@ -1,5 +1,7 @@
*SVN*
* Added db:migrate:redo for rerunning existing migrations #10431 [matt]
* RAILS_GEM_VERSION may be double-quoted also. #10443 [James Cox]
* Update rails:freeze:gems to work with RubyGems 0.9.5. [Jeremy Kemper]

View File

@ -86,6 +86,11 @@ namespace :db do
Rake::Task["db:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby
end
namespace :migrate do
desc 'Rollbacks the database one migration and re migrate up. If you want to rollback more than one step, define STEP=x'
task :redo => [ 'db:rollback', 'db:migrate' ]
end
desc 'Rolls the schema back to the previous version. Specify the number of steps with STEP=n'
task :rollback => :environment do
step = ENV['STEP'] ? ENV['STEP'].to_i : 1