aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2005-09-20 01:33:43 +0000
committerNicholas Seckar <nseckar@gmail.com>2005-09-20 01:33:43 +0000
commit3e2bac428dab23f7455893b62d78be9817906d25 (patch)
treee50e28694de11650a7e145654ac75e02e5f15239
parent390280b842605d78ec1ab968605e5968677c9400 (diff)
downloadrails-3e2bac428dab23f7455893b62d78be9817906d25.tar.gz
rails-3e2bac428dab23f7455893b62d78be9817906d25.tar.bz2
rails-3e2bac428dab23f7455893b62d78be9817906d25.zip
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
-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