drizzle.config.ts18 lines · main
1import type { Config } from 'drizzle-kit';
2
3/**
4 * `drizzle-kit generate` only needs the schema — we leave `dbCredentials`
5 * absent when no URL is set so developers can regenerate migrations offline.
6 * Commands that hit a live database (`migrate`, `push`, `studio`) will fail
7 * explicitly at drizzle-kit's level, which is clearer than throwing here.
8 */
9const url = process.env.BRIVEN_DATABASE_URL;
10
11export default {
12 schema: './src/db/schema.ts',
13 out: './drizzle/migrations',
14 dialect: 'postgresql',
15 dbCredentials: url ? { url } : { url: 'postgres://placeholder@localhost/placeholder' },
16 strict: true,
17 verbose: true,
18} satisfies Config;