mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Improve handling of CURRENT_TIMESTAMP default value
Resolves https://github.com/cakephp/cakephp/issues/12553.
This commit is contained in:
parent
4aa0df8370
commit
1a62c147fe
1 changed files with 1 additions and 1 deletions
|
@ -3539,7 +3539,7 @@ class DboSource extends DataSource {
|
||||||
} elseif (isset($column['null']) && $column['null'] === false) {
|
} elseif (isset($column['null']) && $column['null'] === false) {
|
||||||
$out .= ' NOT NULL';
|
$out .= ' NOT NULL';
|
||||||
}
|
}
|
||||||
if ($type === 'timestamp' && isset($column['default']) && strtolower($column['default']) === 'current_timestamp') {
|
if (in_array($type, array('timestamp', 'datetime')) && isset($column['default']) && strtolower($column['default']) === 'current_timestamp') {
|
||||||
$out = str_replace(array("'CURRENT_TIMESTAMP'", "'current_timestamp'"), 'CURRENT_TIMESTAMP', $out);
|
$out = str_replace(array("'CURRENT_TIMESTAMP'", "'current_timestamp'"), 'CURRENT_TIMESTAMP', $out);
|
||||||
}
|
}
|
||||||
return $this->_buildFieldParameters($out, $column, 'afterDefault');
|
return $this->_buildFieldParameters($out, $column, 'afterDefault');
|
||||||
|
|
Loading…
Reference in a new issue