drizzle.config.ts 653 B

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