diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-12-14 17:47:56 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-12-14 17:47:56 +0000 |
commit | 9187ed86562794e1d078fdf7158cd6f8ea5fbf3b (patch) | |
tree | a663249fba986692eb4cabe100f27311064bcdaf /railties/lib/tasks | |
parent | 9661395d38d18d89b268d729606c7c9180e622e6 (diff) | |
download | rails-9187ed86562794e1d078fdf7158cd6f8ea5fbf3b.tar.gz rails-9187ed86562794e1d078fdf7158cd6f8ea5fbf3b.tar.bz2 rails-9187ed86562794e1d078fdf7158cd6f8ea5fbf3b.zip |
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
Diffstat (limited to 'railties/lib/tasks')
-rw-r--r-- | railties/lib/tasks/databases.rake | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake index 54f9beaede..f1a8e10170 100644 --- a/railties/lib/tasks/databases.rake +++ b/railties/lib/tasks/databases.rake @@ -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 |