Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding support for SQLServer's datetime2 column,

as that is the preferred datetime format in SQLServer.
  • Loading branch information...
commit a825d8280f832292ac13fbedaa0c4bfe180ab21c 1 parent d45b7fa
Mark Story markstory authored
1  lib/Cake/Model/Datasource/Database/Sqlserver.php
View
@@ -238,7 +238,6 @@ public function describe($model) {
$fields[$field]['length'] = $fields[$field]['length'] . ',' . $column->Size;
}
}
- debug($fields);
$this->__cacheDescription($table, $fields);
$cols->closeCursor();
return $fields;
17 lib/Cake/Test/Case/Model/Datasource/Database/SqlserverTest.php
View
@@ -402,7 +402,16 @@ public function testDescribe() {
'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 @@ public function testDescribe() {
'null' => true,
'default' => null,
'length' => null
+ ),
+ 'published' => array(
+ 'type' => 'datetime',
+ 'null' => true,
+ 'default' => '',
+ 'length' => null
)
);
$this->assertEqual($expected, $result);
Please sign in to comment.
Something went wrong with that request. Please try again.