type "GEOMETRY(POINT)" does not exist
Hi there! I try to use PostGIS with drizzle and having a hard time. I try to run the following migration file
But it errors with
Even though PostGIS is setuped successfully. When I run this SQL in supabase directly, it correctly adds the new column with the special data type.
I'm not the only one: https://github.com/drizzle-team/drizzle-orm/issues/1315
Maybe someone has an idea, would be grateful!
GitHub
[BUG]: 'type "geography(Point)" does not exist' when using push:pg ...
What version of drizzle-orm are you using? 0.28.6 What version of drizzle-kit are you using? 0.19.13 Describe the Bug drizzle-kit push:pg does not complete when using a custom type and trying to pu...
7 Replies
Can you try running that statement without the double quotes around the type?
ie:
ALTER TABLE "locations" ADD COLUMN "geoPoint" GEOMETRY(POINT);
Thanks! This worked 🙂 Not sure why they are there, this is my
customType
This might be a drizzle-kit issue it might just add those double quotes by default
Just ran into this same issue trying to implement
bytea
on postgresI am facing the same issue, if I remove the double quotes, I still get the issue
"PostgresError: type "geometry" does not exist"
I also tried with @Fabian B. 's code above
could someone please help? here is how I leverage it
Migration file SQL
nvm, I am stupid... the PostGIS extension failed to install on our database... It works now...
I have the same problem and was wondering, if there is a way to prevent drizzle-kit to wrap the column type with the quotes?
if i use this type in a normal select query, its working. But if I use a the query builder, the fromDriver value is already the correct type so i have to adjust the fromDriver cb :
fromDriver: (value) => {
const point =
typeof value === 'string'
? (fromDriver(value) as Point)
: (value as Point)
const [lng, lat] = point.coordinates
return { lat, lng }
},