diff options
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index 573c6a4f02..1d63bb2f84 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -364,8 +364,10 @@ module ActiveRecord end def current_version - Base.connection.select_values( - "SELECT version FROM #{schema_migrations_table_name}").map(&:to_i).max || 0 + version = Base.connection.select_values( + "SELECT version FROM #{schema_migrations_table_name}" + ).map(&:to_i).max rescue nil + version || 0 end def proper_table_name(name) |