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 ...@@ -409,15 +409,12 @@ abstract class Schema extends Object
static $typeMap = [ // abstract type => php type static $typeMap = [ // abstract type => php type
'smallint' => 'integer', 'smallint' => 'integer',
'integer' => 'integer', 'integer' => 'integer',
'bigint' => 'integer',
'boolean' => 'boolean', 'boolean' => 'boolean',
'float' => 'double', 'float' => 'double',
]; ];
if (isset($typeMap[$column->type])) { if (isset($typeMap[$column->type])) {
if ($column->type === 'bigint') { if ($column->type === 'integer') {
return PHP_INT_SIZE == 8 && !$column->unsigned ? 'integer' : 'string'; return $column->unsigned ? 'string' : 'integer';
} elseif ($column->type === 'integer') {
return PHP_INT_SIZE == 4 && $column->unsigned ? 'string' : 'integer';
} else { } else {
return $typeMap[$column->type]; 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