Skip to content
Browse files

Improved migrations' behavior when the schema_info table is empty.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2269 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 390280b commit 3e2bac428dab23f7455893b62d78be9817906d25 @seckar seckar committed Sep 20, 2005
Showing with 3 additions and 1 deletion.
  1. +2 −0 activerecord/CHANGELOG
  2. +1 −1 activerecord/lib/active_record/migration.rb
View
2 activerecord/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Improved migrations' behavior when the schema_info table is empty. [Nicholas Seckar]
+
* Fixed that Observers didn't observe sub-classes #627 [Florian Weber]
* Fix eager loading error messages, allow :include to specify tables using strings or symbols. Closes #2222 [Marcel Molina]
View
2 activerecord/lib/active_record/migration.rb
@@ -170,7 +170,7 @@ def down(migrations_path, target_version = nil)
end
def current_version
- (Base.connection.select_one("SELECT version FROM schema_info") || {})["version"].to_i
+ (Base.connection.select_one("SELECT version FROM schema_info") || {"version" => 0})["version"].to_i
end
end

0 comments on commit 3e2bac4

Please sign in to comment.
Something went wrong with that request. Please try again.