-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[7.x] Added support for separation between geometry and geography types #30552
Conversation
private function formatPostGisType(string $type, Fluent $column) | ||
{ | ||
if ($column->geography !== null) { | ||
return "geography($type, ".($column->projection === null ? '4326' : $column->projection).')'; |
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.
I'm not sure, but maybe it will be better to use sprintf
method here for better readability?
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.
I actually just rewrote it with a null coalescer, for that exact reason. Still noodling about what to do on 906 for readability though.
The differences in this PR as opposed to #30545 are:
|
@raymondtri tests are failing. |
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.
I think sprintf will be much readable in this case.
private function formatPostGisType(string $type, Fluent $column) | ||
{ | ||
if ($column->geography !== null) { | ||
return "geography($type, ".($column->projection ?? '4326').')'; |
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.
return sprintf('geography(%s, %s)', $type, $column->projection ?? '4326');
Please submit with passing tests. |
This relates directly to #30545, the arguments for setting geometry as the default type as opposed to the current default geography are there.
However since modifying this default is a breaking change, I believe it would be a pr for a new major version.
I will be updating the 6.x PR to be non-breaking.