creof / doctrine2-spatial

Doctrine2 multi-platform support for spatial types and functions.
MIT License
272 stars 176 forks source link

Spatial index detection in schema #198

Open lowwa132 opened 5 years ago

lowwa132 commented 5 years ago

Each time I execute a schema update with --dump-sql SQL option, it gives me:

DROP INDEX IDX_4C416148DD30FFD8 ON geo_table;
CREATE SPATIAL INDEX IDX_4C416148DD30FFD8 ON geo_table (shape);

Even if I execute it with --force option, it always want to drop and recreate the index (with the same name).

I don't know what it's worth, but I remember I had this bug a year ago. It was not present anymore, and reappared after I did a composer update (doctrine/orm upgraded from 2.6.2 to 2.6.3).

sela commented 5 years ago

Did you try to create a new database and run all your migrations and then running again the schema update --dump-sql?

lowwa132 commented 5 years ago

I've just tried, same thing happening.

echantigny commented 3 years ago

I have the same issue here. Was this ever fixed or is there any workaround?

sadortun commented 3 years ago

Hi @echantigny, if you still have the issue with master it's probably not fixed ;)

feel free to submit a PR if you find the issue.

echantigny commented 3 years ago

For anyone seeing this late, the solution for me was: @ORM\Index(name="center_point", columns={"center_point"}, options={"flags"="spatial"})

I hope this helps out someone.