Changed the default empty value when create columns.

This commit is contained in:
Juan Basso 2011-05-21 21:50:25 -04:00
parent c602fc845b
commit 375f86d2a6

View file

@ -636,7 +636,11 @@ class Mssql extends DboSource {
function buildColumn($column) {
$result = preg_replace('/(int|integer)\([0-9]+\)/i', '$1', parent::buildColumn($column));
if (strpos($result, 'DEFAULT NULL') !== false) {
$result = str_replace('DEFAULT NULL', 'NULL', $result);
if (isset($column['default']) && $column['default'] === '') {
$result = str_replace('DEFAULT NULL', "DEFAULT ''", $result);
} else {
$result = str_replace('DEFAULT NULL', 'NULL', $result);
}
} else if (array_keys($column) == array('type', 'name')) {
$result .= ' NULL';
}