Closed swen100 closed 7 years ago
I can't reproduce this. Could you give a little bit more information about the setup, ideally a minimal reproducible test case?
Hi,
my entity has two attributes: title and a geometry. As described in your documentation, I just set the "spatial" flag to create a spatial index on the geometry column "geometry". But I am using xml instead of annotation or yaml.
This is what is on the documentation site:
/**
* @Entity
* @Table(
* indexes={
* @Index(name="idx_point", columns={"point"}, flags={"spatial"})),
* @Index(name="idx_polygon", columns={"polygon"}, flags={"spatial"}))
* }
* )
*/
class MyEntity
{
}
Everything works fine until creation of spatial index.
php bin/console doctrine:schema:create
-> table is created, but if I add the "spatial"-flag and then call
php bin\console doctrine:schema:update --dump-sql
I get CREATE INDEX geometry_IDX ON geo (geometry);
But it should be:
CREATE INDEX geometry_IDX ON geo USING gist(geometry);
Yes, that's what i tested (with XML mapping instead of annotations) and it worked correctly for me. That's why i asked for a reduced test case which reproduces the behaviour because i've been not able to reproduce it.
Hm, I tried it out again and it works now. I don't know what I did wrong nor what I had changed meanwhile to get it work. Anyway, this issue can be closed. I'm sorry for the inconvenience.
Hi,
I am using Symfony v3.3.0 and doctrine v2.5.5 As described here https://github.com/jsor/doctrine-postgis#spatial-indexes my doctrine-config is the following:
So, I have set the flag with flags="spatial", but with the console I only get a "normal" index:
gives:
CREATE INDEX geometry_IDX ON geo (geometry);