Open mauriciabad opened 7 months ago
Suggestions: Add dependencies for extensions, such as declaring schemas, so they would end up in the migrations.
Example:
import { env } from "@/env.mjs"
import { drizzle } from "drizzle-orm/postgres-js"
import { sql } from "drizzle-orm"
import postgres from "postgres"
import * as schema from "./load-schema"
const client = postgres(env.DATABASE_URL)
export const db = drizzle(client, {
schema,
extensions: {
vector: sql`create extension if not exists vector with schema extensions;`,
pg_trgm: sql`create extension if not exists pg_trgm with schema extensions;`
}
})
Maybe this issue is already solved.
In this docs they add run npx drizzle-kit generate --custom
and add CREATE EXTENSION postgis;
to the migration file.
https://orm.drizzle.team/learn/guides/postgis-geometry-point
Describe what you want
Hi, I want to use PostGIS but I cant find any way to add
CREATE EXTENSION IF NOT EXISTS postgis;
to the migrations files automatically. The ideal solution would be to somehow add support forCREATE EXTENSION
, and include the generated tables to the schema.Related to: https://github.com/drizzle-team/drizzle-orm/issues/671 and https://github.com/drizzle-team/drizzle-orm/issues/1315