openreader/drizzle.config.pg.ts
Richard R 297752e83e fix(db): select drizzle config for migrations
Add dedicated Drizzle config files for sqlite and postgres and generate
new migration outputs for each dialect.

Update migrate scripts to load env files and auto-pick the correct
config unless explicitly provided, and tighten API auth handling by
using shared auth context helpers and enforcing userId checks when auth
is enabled.
2026-01-27 16:53:58 -07:00

18 lines
386 B
TypeScript

import type { Config } from 'drizzle-kit';
import * as dotenv from 'dotenv';
dotenv.config();
const url = process.env.POSTGRES_URL;
if (!url) {
throw new Error('POSTGRES_URL is required for drizzle.config.pg.ts');
}
export default {
schema: './src/db/schema_postgres.ts',
out: './drizzle/postgres',
dialect: 'postgresql',
dbCredentials: {
url,
},
} satisfies Config;