-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdrizzle.config.ts
More file actions
25 lines (24 loc) · 1009 Bytes
/
Copy pathdrizzle.config.ts
File metadata and controls
25 lines (24 loc) · 1009 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { defineConfig } from 'drizzle-kit';
// drizzle-kit connects via the `url` below and IGNORES a `dbCredentials.ssl` object
// when a `url` is set, so the SSL intent must be encoded in the connection string as
// `sslmode`. `applyDbSslModeToUrl` derives it from DATABASE_SSL (shared with the runtime
// client's resolver), letting `DATABASE_SSL=no-verify` work against managed Postgres with
// self-signed certs (e.g. Supabase's pooler), which strict verification would reject.
import { applyDbSslModeToUrl } from './src/db/ssl-config';
export default defineConfig({
schema: [
'./src/db/schema/organizations.ts',
'./src/db/schema/credentials.ts',
'./src/db/schema/defaults.ts',
'./src/db/schema/projects.ts',
'./src/db/schema/agentConfigs.ts',
'./src/db/schema/integrations.ts',
'./src/db/schema/runs.ts',
'./src/db/schema/promptPartials.ts',
],
out: './src/db/migrations',
dialect: 'postgresql',
dbCredentials: {
url: applyDbSslModeToUrl(process.env.DATABASE_URL ?? ''),
},
});