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

Doctrine repeatly alters geography-type field #182

Open
forsetius opened this issue Sep 27, 2017 · 2 comments
Open

Doctrine repeatly alters geography-type field #182

forsetius opened this issue Sep 27, 2017 · 2 comments

Comments

@forsetius
Copy link

Having configured the bundle:

doctrine:
    dbal:
        types:
            geometry:   CrEOF\Spatial\DBAL\Types\GeometryType
            geography:   CrEOF\Spatial\DBAL\Types\GeographyType

in entity class I defined a field:

    /**
     * @ORM\Column(type="geography", nullable=true)
     */
    protected $geomshape;

then executed bin/console doctrine:generate:entities... and bin/console doctrine:schema:update.
Now in the Postgres DB I have a new geomshape field of geography type but it's comment is DC2Type:geometry.

Problem is that on the next time I use bin/console doctrine:schema:update it wants to alter geomshape field to type Geography again:

ALTER TABLE geo_objects ALTER geomshape TYPE Geography;

And again, every time I use d:s:u. Is this my fault (perhaps misconfiguration) or a bug?

@forsetius forsetius changed the title Doctrine repeatly creates geometry-type field Doctrine repeatly alters geography-type field Sep 27, 2017
@jsor
Copy link

jsor commented Sep 27, 2017

Probably the same as jsor/doctrine-postgis#31

@forsetius
Copy link
Author

Nope, I tried to use @jsor 's solution with commented: false but to no avail. Then I deleted the field and allowed Doctrine to create it again. Now, the comment was correctly (DC2Type:geography). Then I commented out that commented: false and deleted and created field. Again, the comment was correct. Anyway, once correctly created, the Doctrine doesn't want to alter it again. Solved

Then I remembered that last week I changed the type of this field from geometry to geography. Turns out that Doctrine didn't update the comment. I don't know if it is something on this bundle or Doctrine's side. If you think it is on Doctrine side, please close this issue.

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