aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-12-03 11:44:11 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-12-03 12:00:09 -0800
commit47737681fdfe4986dc7426b174f81d2b8daca991 (patch)
treeb7dfb614ca77c5c702c030af20fa7ae91cb8a0dc /activerecord/lib
parent226ea0e9e817a2e449d989d925c36cf6a4cfd67b (diff)
downloadrails-47737681fdfe4986dc7426b174f81d2b8daca991.tar.gz
rails-47737681fdfe4986dc7426b174f81d2b8daca991.tar.bz2
rails-47737681fdfe4986dc7426b174f81d2b8daca991.zip
in the middle of refactoring
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/migration.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb
index d80416149e..4dc67a0905 100644
--- a/activerecord/lib/active_record/migration.rb
+++ b/activerecord/lib/active_record/migration.rb
@@ -518,6 +518,7 @@ module ActiveRecord
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
@@ -647,6 +648,7 @@ module ActiveRecord
# skip the last migration if we're headed down, but not ALL the way down
runnable.pop if down? && target
+ ran = []
runnable.each do |migration|
Base.logger.info "Migrating to #{migration.name} (#{migration.version})" if Base.logger
@@ -666,11 +668,13 @@ module ActiveRecord
migration.migrate(@direction)
record_version_state_after_migrating(migration.version)
end
+ ran << migration
rescue => e
canceled_msg = Base.connection.supports_ddl_transactions? ? "this and " : ""
raise StandardError, "An error has occurred, #{canceled_msg}all later migrations canceled:\n\n#{e}", e.backtrace
end
end
+ ran
end
def migrations