mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding support for SQLServer's datetime2 column,
as that is the preferred datetime format in SQLServer.
This commit is contained in:
parent
d45b7fa174
commit
a825d8280f
2 changed files with 16 additions and 2 deletions
|
@ -238,7 +238,6 @@ class Sqlserver extends DboSource {
|
|||
$fields[$field]['length'] = $fields[$field]['length'] . ',' . $column->Size;
|
||||
}
|
||||
}
|
||||
debug($fields);
|
||||
$this->__cacheDescription($table, $fields);
|
||||
$cols->closeCursor();
|
||||
return $fields;
|
||||
|
|
|
@ -402,7 +402,16 @@ class SqlserverTest extends CakeTestCase {
|
|||
'Length' => -1,
|
||||
'Null' => 'YES',
|
||||
'Type' => 'nvarchar'
|
||||
)
|
||||
),
|
||||
(object) array(
|
||||
'Default' => '',
|
||||
'Field' => 'published',
|
||||
'Key' => 0,
|
||||
'Type' => 'datetime2',
|
||||
'Length' => 8,
|
||||
'Null' => 'YES',
|
||||
'Size' => ''
|
||||
),
|
||||
));
|
||||
$this->db->executeResultsStack = array($SqlserverTableDescription);
|
||||
$dummyModel = $this->model;
|
||||
|
@ -419,6 +428,12 @@ class SqlserverTest extends CakeTestCase {
|
|||
'null' => true,
|
||||
'default' => null,
|
||||
'length' => null
|
||||
),
|
||||
'published' => array(
|
||||
'type' => 'datetime',
|
||||
'null' => true,
|
||||
'default' => '',
|
||||
'length' => null
|
||||
)
|
||||
);
|
||||
$this->assertEqual($expected, $result);
|
||||
|
|
Loading…
Reference in a new issue