aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/CHANGELOG2
-rw-r--r--activerecord/lib/active_record/migration.rb2
2 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index fc2447f172..0301572b23 100644
--- a/activerecord/CHANGELOG
+++ b/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]
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb
index 9cde37548d..a772dce55a 100644
--- a/activerecord/lib/active_record/migration.rb
+++ b/activerecord/lib/active_record/migration.rb
@@ -170,7 +170,7 @@ module ActiveRecord
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