-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: add support for function as default value #6441
base: 4.3.x
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Please add functional tests that cover the creation, introspection and comparison of columns with this kind of default value. The test that you provided never hits a database, so I don't really know if your change actually works.
Also, please keep in mind that we only allow bugfixes on the 3.8.x branch. Your change however adds new functionality. For that, please target 4.1.x. |
d61d985
to
24a2b4a
Compare
6e4e4ea
to
fee7382
Compare
Schema comparison is still not covered. |
self::assertTrue( | ||
$sm->createComparator() | ||
->compareTables($table, $onlineTable) | ||
->isEmpty(), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good! Now, what happens if the introspected table…
- … has no default?
- … has a literal value as default?
- … has
NULL
as default? - … has a different expression as default?
In that case, we would expect the schema manager to execute the proper SQL to migrate the deployed table and we need to verify that this migration performed successfully.
This has to be covered with tests as well.
Sames goes for the opposite direction: The schema deployed to the database has a column with a default expression and we want to change that to a literal, NULL
, no default or a different expression.
There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
Summary
Added support for function as default value, for example
id UUID NOT NULL DEFAULT gen_random_uuid()