Browse files

Adding support for SQLServer's datetime2 column,

as that is the preferred datetime format in SQLServer.
  • Loading branch information...
1 parent d45b7fa commit a825d8280f832292ac13fbedaa0c4bfe180ab21c @markstory markstory committed Jun 22, 2011
View
1 lib/Cake/Model/Datasource/Database/Sqlserver.php
@@ -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;
View
17 lib/Cake/Test/Case/Model/Datasource/Database/SqlserverTest.php
@@ -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);

0 comments on commit a825d82

Please sign in to comment.