diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index 12ca029..8a19c7a 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -542,10 +542,10 @@ module ActiveRecord # Maps logical Rails types to MySQL-specific data types. def type_to_sql(type, limit = nil, precision = nil, scale = nil) case type.to_s - when 'primary_key': + when 'primary_key' native = native_database_types[:primary_key] return type_to_sql('integer', limit) + ' ' + native[:name] - when 'integer': + when 'integer' case limit when 1; 'tinyint' when 2; 'smallint'