mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Treat any limit > 4 as bigint
This commit is contained in:
parent
f1cfd12487
commit
290e1e2fc5
1 changed files with 8 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue