File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 11import type { Config } from "drizzle-kit" ;
22import * as dotenv from "dotenv" ;
3- import { webEnv } from "@/lib/env/web" ;
43
5- if ( webEnv . NODE_ENV === "production" ) {
4+ if ( process . env . NODE_ENV === "production" ) {
65 dotenv . config ( { path : ".env.production" } ) ;
76} else {
87 dotenv . config ( { path : ".env.local" } ) ;
98}
109
10+ const databaseUrl = process . env . DATABASE_URL ;
11+ if ( ! databaseUrl ) {
12+ throw new Error ( "DATABASE_URL is not set" ) ;
13+ }
14+
1115export default {
1216 schema : "./src/schema.ts" ,
1317 dialect : "postgresql" ,
1418 migrations : {
1519 table : "drizzle_migrations" ,
1620 } ,
1721 dbCredentials : {
18- url : webEnv . DATABASE_URL ,
22+ url : databaseUrl ,
1923 } ,
2024 out : "./migrations" ,
21- strict : webEnv . NODE_ENV === "production" ,
25+ strict : process . env . NODE_ENV === "production" ,
2226} satisfies Config ;
You can’t perform that action at this time.
0 commit comments