Permalink
Browse files

Adding float precision support to CakeSchema when using Sqlsrv

  • Loading branch information...
1 parent 0cc76b3 commit 9f85e24413815ba5cd1c1d8d86e2a6ccdb6d902b @lorenzo lorenzo committed Jun 20, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/Cake/Model/Datasource/Database/Sqlserver.php
View
3 lib/Cake/Model/Datasource/Database/Sqlserver.php
@@ -221,6 +221,9 @@ public function describe($model) {
if (in_array($fields[$field]['type'], array('date', 'time', 'datetime', 'timestamp'))) {
$fields[$field]['length'] = null;
}
+ if ($fields[$field]['type'] == 'float' && !empty($column->Size)) {
+ $fields[$field]['length'] = $fields[$field]['length'] . ',' . $column->Size;
+ }
}
$this->__cacheDescription($table, $fields);
$cols->closeCursor();

0 comments on commit 9f85e24

Please sign in to comment.