Commit 266aadd2 by Qiang Xue

Only treat 32bit signed integers as integers so that 32bit clients won’t have trouble.

parent 8001d234
......@@ -409,15 +409,12 @@ abstract class Schema extends Object
static $typeMap = [ // abstract type => php type
'smallint' => 'integer',
'integer' => 'integer',
'bigint' => 'integer',
'boolean' => 'boolean',
'float' => 'double',
];
if (isset($typeMap[$column->type])) {
if ($column->type === 'bigint') {
return PHP_INT_SIZE == 8 && !$column->unsigned ? 'integer' : 'string';
} elseif ($column->type === 'integer') {
return PHP_INT_SIZE == 4 && $column->unsigned ? 'string' : 'integer';
if ($column->type === 'integer') {
return $column->unsigned ? 'string' : 'integer';
} else {
return $typeMap[$column->type];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment