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

Schema update fails if table-name is a reserved word #19

Closed
maximilian-walter opened this issue Nov 25, 2016 · 3 comments
Closed

Schema update fails if table-name is a reserved word #19

maximilian-walter opened this issue Nov 25, 2016 · 3 comments

Comments

@maximilian-walter
Copy link

The schema update fails if the table-name is a reserved word, because the table-name will be quoted by Doctrine and the select-query which returns the column-information fails. So Doctrine thinks he has to change the "geometry_type" (from a empty string to the configured value), which is not supported (see #5).

The table-name was in my case user, which will be converted to "user", which results in the following query:

SELECT coord_dimension, srid, type FROM geometry_columns WHERE f_table_name = '"user"' AND f_geometry_column = 'coordinates';

public function getGeometrySpatialColumnInfo($table, $column)

I'm new to Doctrine and I have no idea how to safely unquote the table-name, Is trim($table, '"'); sufficient, or is there a better way?

I'm using PostgreSql 9.5 and the most current Doctrine-version.

@jsor
Copy link
Owner

jsor commented Nov 25, 2016

I've commited a patch in a2ae238. Could you try the reserved-words branch (composer require jsor/doctrine-postgis dev-reserved-words) and report back if it fixes the issue.

@maximilian-walter
Copy link
Author

Thank you for your fast response! The patch fixes the problem for me.

@jsor
Copy link
Owner

jsor commented Nov 28, 2016

Thanks for reporting back! Fix released in v1.1.2.

@jsor jsor closed this as completed Nov 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants