<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -406,12 +406,14 @@ module ActiveRecord
         Base.table_name_prefix + 'schema_migrations' + Base.table_name_suffix
       end
 
+      def get_all_versions
+        Base.connection.select_values(&quot;SELECT version FROM #{schema_migrations_table_name}&quot;).map(&amp;:to_i).sort
+      end
+
       def current_version
         sm_table = schema_migrations_table_name
         if Base.connection.table_exists?(sm_table)
-          Base.connection.select_value(
-            &quot;SELECT MAX(CAST(version AS DECIMAL)) FROM #{sm_table}&quot;
-          ).to_i
+          get_all_versions.max || 0
         else
           0
         end
@@ -521,8 +523,7 @@ module ActiveRecord
     end
 
     def migrated
-      sm_table = self.class.schema_migrations_table_name
-      @migrated_versions ||= Base.connection.select_values(&quot;SELECT version FROM #{sm_table}&quot;).map(&amp;:to_i).sort
+      @migrated_versions ||= self.class.get_all_versions
     end
 
     private</diff>
      <filename>activerecord/lib/active_record/migration.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>973c0ef26d94b5cf2bd29dce177357d5905be211</id>
    </parent>
  </parents>
  <author>
    <name>Tarmo T&#228;nav</name>
    <email>tarmo@itech.ee</email>
  </author>
  <url>http://github.com/rails/rails/commit/00d2165f748bc3d7c235daa959c54266a0a283db</url>
  <id>00d2165f748bc3d7c235daa959c54266a0a283db</id>
  <committed-date>2008-08-26T03:00:36-07:00</committed-date>
  <authored-date>2008-08-26T02:57:33-07:00</authored-date>
  <message>Back to fetching all versions in ruby instead of letting SQL do it as it's difficult to get all databases to convert the text value to a number with the same SQL

Signed-off-by: Jeremy Kemper &lt;jeremy@bitsweat.net&gt;</message>
  <tree>449e11b2b8669c20807917fade197da0ef20ae76</tree>
  <committer>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </committer>
</commit>
