I have a Rails app and am running this query:
partner_found = Partner.find_by("partners.geo_polygon @> point '(:lat,:lng)'", lat: latitude, lng: longitude)
In my dev environment this runs fine, but in test it throws an error:
PG::UndefinedFunction: ERROR: operator does not exist: character varying @> point
Both my dev and test environments are running Postgres databases. What am I missing?
edit: More info, my test database created the geo_polygon columns as character varying
while it is correctly polygon
in the development database.
Thanks Rahul! The test database was missing hstore. I turned it on is psql with CREATE EXTENSION IF NOT EXISTS hstore;
I also added to my migration: enable_extension "hstore"
Also I found these answers at http://nandovieira.com/using-postgresql-and-hstore-with-rails
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments