R3N
6 months ago
596
10
Eloquent

Doest $table->spatialIndex('location'); support PostgreSQL ?

Posted 6 months ago by R3N

I need to implement this spartial GIST index for Postgist

CREATE TABLE test (geog GEOGRAPHY(POINT));
CREATE INDEX gix_test_geog ON test USING GIST (geog);
INSERT INTO test (geog)
	VALUES (ST_Point(-66.1160422, 18.4682047)),
		(ST_Point(-66.1200, 18.4682));

So Wondering if using this would be good enough? to Create the Index? As well if this compatible with Postgres?

https://laravel.com/docs/7.x/migrations#indexes

$table->spatialIndex('location');

Really confused about this and there is not much info online.

Please sign in or create an account to participate in this conversation.