aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-06-23 18:16:03 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2008-06-23 18:16:03 -0700
commit290e1e2fc53d80165cc876491ec0cbe18be376cf (patch)
treeab8545b9ed70fc4fa9a22cc548fba9b6d538bd77 /activerecord/lib
parentf1cfd1248734ceaa50c1857f33d7ee0ecfdce3e6 (diff)
downloadrails-290e1e2fc53d80165cc876491ec0cbe18be376cf.tar.gz
rails-290e1e2fc53d80165cc876491ec0cbe18be376cf.tar.bz2
rails-290e1e2fc53d80165cc876491ec0cbe18be376cf.zip
Treat any limit > 4 as bigint
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-xactiverecord/lib/active_record/connection_adapters/mysql_adapter.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
index ed1f08ac4f..dd54950790 100755
--- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
@@ -111,10 +111,11 @@ module ActiveRecord
else
super # we could return 65535 here, but we leave it undecorated by default
end
- when /^int/i; 4
when /^bigint/i; 8
- when /^smallint/i; 2
+ when /^int/i; 4
when /^mediumint/i; 3
+ when /^smallint/i; 2
+ when /^tinyint/i; 1
else
super
end
@@ -472,10 +473,11 @@ module ActiveRecord
return super unless type.to_s == 'integer'
case limit
- when 1..2; 'smallint'
- when 3; 'mediumint'
- when 4, nil; 'int(11)'
- when 5..8; 'bigint'
+ when 1; 'tinyint'
+ when 2; 'smallint'
+ when 3; 'mediumint'
+ when 4, nil; 'int(11)'
+ else; 'bigint'
end
end