Skip to content

Commit aef7b0c

Browse files
committed
fix: skip migrations gracefully when POSTGRES_URL not defined
1 parent d8ce57b commit aef7b0c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/db/migrate.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ config({
99

1010
const runMigrate = async () => {
1111
if (!process.env.POSTGRES_URL) {
12-
throw new Error("POSTGRES_URL is not defined");
12+
console.log("⏭️ POSTGRES_URL not defined, skipping migrations");
13+
process.exit(0);
1314
}
1415

1516
const connection = postgres(process.env.POSTGRES_URL, { max: 1 });

0 commit comments

Comments
 (0)