mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
SQL Server support of numeric type. #3171
Float & real map to float. Numeric & decimal map to numeric.
This commit is contained in:
parent
c74c8d49a1
commit
73cae88a6f
1 changed files with 8 additions and 2 deletions
|
@ -93,7 +93,10 @@ class Sqlserver extends DboSource {
|
|||
'text' => array('name' => 'nvarchar', 'limit' => 'MAX'),
|
||||
'integer' => array('name' => 'int', 'formatter' => 'intval'),
|
||||
'biginteger' => array('name' => 'bigint'),
|
||||
'float' => array('name' => 'numeric', 'formatter' => 'floatval'),
|
||||
'numeric' => array('name' => 'decimal', 'formatter' => 'floatval'),
|
||||
'decimal' => array('name' => 'decimal', 'formatter' => 'floatval'),
|
||||
'float' => array('name' => 'float', 'formatter' => 'floatval'),
|
||||
'real' => array('name' => 'float', 'formatter' => 'floatval'),
|
||||
'datetime' => array('name' => 'datetime', 'format' => 'Y-m-d H:i:s', 'formatter' => 'date'),
|
||||
'timestamp' => array('name' => 'timestamp', 'format' => 'Y-m-d H:i:s', 'formatter' => 'date'),
|
||||
'time' => array('name' => 'datetime', 'format' => 'H:i:s', 'formatter' => 'date'),
|
||||
|
@ -441,9 +444,12 @@ class Sqlserver extends DboSource {
|
|||
if (strpos($col, 'binary') !== false || $col === 'image') {
|
||||
return 'binary';
|
||||
}
|
||||
if (in_array($col, array('float', 'real', 'decimal', 'numeric'))) {
|
||||
if (in_array($col, array('float', 'real'))) {
|
||||
return 'float';
|
||||
}
|
||||
if (in_array($col, array('decimal', 'numeric'))) {
|
||||
return 'decimal';
|
||||
}
|
||||
return 'text';
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue