aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorNeeraj Singh <neerajdotname@gmail.com>2010-04-20 11:14:00 -0400
committerJosé Valim <jose.valim@gmail.com>2010-04-29 13:41:35 +0200
commitf4d174b211effd4cd510c1578bdc391852f4d375 (patch)
treec2da99f8836314c0175eb7a8b75c898384e9207a /activerecord/lib/active_record
parent68c96fad55fb13164e339426d7f1cbc88d4ccc8b (diff)
downloadrails-f4d174b211effd4cd510c1578bdc391852f4d375.tar.gz
rails-f4d174b211effd4cd510c1578bdc391852f4d375.tar.bz2
rails-f4d174b211effd4cd510c1578bdc391852f4d375.zip
making rake:migrate VERSION=0 a noop called in succession. [#2137 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/migration.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb
index c163fb982a..940f825038 100644
--- a/activerecord/lib/active_record/migration.rb
+++ b/activerecord/lib/active_record/migration.rb
@@ -384,9 +384,13 @@ module ActiveRecord
class << self
def migrate(migrations_path, target_version = nil)
case
- when target_version.nil? then up(migrations_path, target_version)
- when current_version > target_version then down(migrations_path, target_version)
- else up(migrations_path, target_version)
+ when target_version.nil?
+ up(migrations_path, target_version)
+ when current_version == 0 && target_version == 0
+ when current_version > target_version
+ down(migrations_path, target_version)
+ else
+ up(migrations_path, target_version)
end
end