aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-12-14 17:47:56 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-12-14 17:47:56 +0000
commit9187ed86562794e1d078fdf7158cd6f8ea5fbf3b (patch)
treea663249fba986692eb4cabe100f27311064bcdaf
parent9661395d38d18d89b268d729606c7c9180e622e6 (diff)
downloadrails-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
-rw-r--r--activesupport/MIT-LICENSE2
-rw-r--r--railties/CHANGELOG2
-rw-r--r--railties/lib/tasks/databases.rake5
3 files changed, 8 insertions, 1 deletions
diff --git a/activesupport/MIT-LICENSE b/activesupport/MIT-LICENSE
index c1caf0bfc1..dbe78035ba 100644
--- a/activesupport/MIT-LICENSE
+++ b/activesupport/MIT-LICENSE
@@ -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
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index 6d1cffa067..351161279a 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -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]
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