mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-08 04:22:40 +00:00
introduce new tinyint, smallint types for smaller storage requirements
This commit is contained in:
parent
216ae0ec0c
commit
38101995b4
9 changed files with 79 additions and 128 deletions
|
@ -84,6 +84,8 @@ class Sqlserver extends DboSource {
|
|||
/**
|
||||
* MS SQL column definition
|
||||
*
|
||||
* @link https://msdn.microsoft.com/en-us/library/ms187752.aspx SQL Server Data Types
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $columns = array(
|
||||
|
@ -91,6 +93,8 @@ class Sqlserver extends DboSource {
|
|||
'string' => array('name' => 'nvarchar', 'limit' => '255'),
|
||||
'text' => array('name' => 'nvarchar', 'limit' => 'MAX'),
|
||||
'integer' => array('name' => 'int', 'formatter' => 'intval'),
|
||||
'smallint' => array('name' => 'smallint', 'formatter' => 'intval'),
|
||||
'tinyint' => array('name' => 'tinyint', 'formatter' => 'intval'),
|
||||
'biginteger' => array('name' => 'bigint'),
|
||||
'numeric' => array('name' => 'decimal', 'formatter' => 'floatval'),
|
||||
'decimal' => array('name' => 'decimal', 'formatter' => 'floatval'),
|
||||
|
@ -435,6 +439,12 @@ class Sqlserver extends DboSource {
|
|||
if (strpos($col, 'bigint') !== false) {
|
||||
return 'biginteger';
|
||||
}
|
||||
if (strpos($col, 'smallint') !== false) {
|
||||
return 'smallint';
|
||||
}
|
||||
if (strpos($col, 'tinyint') !== false) {
|
||||
return 'tinyint';
|
||||
}
|
||||
if (strpos($col, 'int') !== false) {
|
||||
return 'integer';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue