zikk
zikk
Explore posts from servers
DTDrizzle Team
Created by zikk on 4/5/2024 in #help
How to stop drizzle-kit push from truncating every time ?
As the title says, some column changes make the query have unnecessary truncates. Also, i have a pg timestamp(3) field and the push every time shows me this You're about to change created_at column type from timestamp(3) to timestamp (3) with <x> items
2 replies
DTDrizzle Team
Created by zikk on 4/4/2024 in #help
Create query inserts quotes for customType with push
Hey people. So i am using PostGIS as my database, and i created a custom type for the geogrraphy point
export const geoPoint = customType<{ data: never }>({
dataType() {
return "geography(Point, 4326)";
},
toDriver(value: Point) {
return sql`ST_MakePoint(${value.latitude}, ${value.longitude})`;
},
});
export const geoPoint = customType<{ data: never }>({
dataType() {
return "geography(Point, 4326)";
},
toDriver(value: Point) {
return sql`ST_MakePoint(${value.latitude}, ${value.longitude})`;
},
});
The issue lies when i use drizzle-kit push, it makes a create query that puts the type inside quotations marks (which breaks the db query) How do i make it so that it creates the DB creation query correctly ?
...
"coords" "geography(Point, 4326)" NOT NULL,
...
...
"coords" "geography(Point, 4326)" NOT NULL,
...
error: type "geography(Point, 4326)" does not exist
error: type "geography(Point, 4326)" does not exist
2 replies