Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres alter column error #19929

Open
daniil-khaletsky opened this issue Aug 17, 2023 · 0 comments
Open

Postgres alter column error #19929

daniil-khaletsky opened this issue Aug 17, 2023 · 0 comments
Labels

Comments

@daniil-khaletsky
Copy link

daniil-khaletsky commented Aug 17, 2023

https://github.com/yiisoft/yii2/blob/73902f0730454f499d1a8bb49382e5021943656e/framework/db/pgsql/QueryBuilder.php#L266C48-L266C48

If the default value is a function then brackets with parametrs are ignored. Example:

TYPE TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() => 

set $type => TYPE TIMESTAMP WITH TIME ZONE()  // error, must be TYPE TIMESTAMP WITH TIME ZONE
set $multiAlterStatement => [
    'ALTER COLUMN "date" SET DEFAULT NOW', // error, must be 'ALTER COLUMN "date" SET DEFAULT NOW()'
    'ALTER COLUMN "date" SET NOT NULL',
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants