mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 13:02:24 +08:00
Fix #20329: pgsql: Column Schema doesn't recognize PG type cast
This commit is contained in:
@ -552,10 +552,13 @@ SQL;
|
||||
} elseif ($column->defaultValue) {
|
||||
if (
|
||||
in_array($column->type, [self::TYPE_TIMESTAMP, self::TYPE_DATE, self::TYPE_TIME], true) &&
|
||||
in_array(
|
||||
strtoupper($column->defaultValue),
|
||||
['NOW()', 'CURRENT_TIMESTAMP', 'CURRENT_DATE', 'CURRENT_TIME'],
|
||||
true
|
||||
(
|
||||
in_array(
|
||||
strtoupper($column->defaultValue),
|
||||
['NOW()', 'CURRENT_TIMESTAMP', 'CURRENT_DATE', 'CURRENT_TIME'],
|
||||
true
|
||||
) ||
|
||||
(false !== strpos($column->defaultValue, '('))
|
||||
)
|
||||
) {
|
||||
$column->defaultValue = new Expression($column->defaultValue);
|
||||
|
||||
Reference in New Issue
Block a user