File tree Expand file tree Collapse file tree 1 file changed +18
-8
lines changed
Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change 1- import { defineConfig } from "drizzle-kit" ;
1+ import type { Config } from "drizzle-kit" ;
22import { env } from "./src/env" ;
33
44if ( ! env . DATABASE_URL ) env . DATABASE_URL = "file:./lavamusic-pgdata" ;
55
6- export default defineConfig ( {
7- out : "./drizzle/postgres" ,
8- schema : "./src/database/schemas.ts" ,
9- dialect : "postgresql" ,
10- driver : "pglite" ,
11- dbCredentials : { url : env . DATABASE_URL } ,
12- } ) ;
6+ const isPgLite =
7+ ! env . DATABASE_URL . startsWith ( "postgres://" ) &&
8+ ! env . DATABASE_URL . startsWith ( "postgresql://" ) ;
9+
10+ const config : Config = {
11+ out : "./drizzle/postgres" ,
12+ schema : "./src/database/schemas.ts" ,
13+ dialect : "postgresql" ,
14+ dbCredentials : { url : env . DATABASE_URL } ,
15+ } ;
16+
17+ // Only add driver for PGLite
18+ if ( isPgLite ) {
19+ config . driver = "pglite" ;
20+ }
21+
22+ export default config ;
You can’t perform that action at this time.
0 commit comments