20 lines
471 B
TypeScript
20 lines
471 B
TypeScript
import { defineConfig } from 'drizzle-kit';
|
|
|
|
// Support both SQLite (local development) and PostgreSQL (production)
|
|
const isLocal = !process.env.DATABASE_URL;
|
|
const dialect = isLocal ? 'sqlite' : 'postgresql';
|
|
|
|
export default defineConfig({
|
|
schema: './db/schema.ts',
|
|
out: './db/migrations',
|
|
dialect,
|
|
dbCredentials: isLocal
|
|
? {
|
|
url: 'file:./dev.db',
|
|
}
|
|
: {
|
|
url: process.env.DATABASE_URL!,
|
|
},
|
|
strict: true,
|
|
verbose: true,
|
|
});
|