mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Changed the default empty value when create columns.
This commit is contained in:
parent
c602fc845b
commit
375f86d2a6
1 changed files with 5 additions and 1 deletions
|
@ -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';
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue