N
Neon2y ago
xenial-black

Vercel deployment gets stuck on drizzle-kit migrate?

Hello I have overriden the default build command on Vercel to be:
pnpm run db:migrate && next dev
pnpm run db:migrate && next dev
Whenever the first step runs, the deployment just gets stuck and we never move on to next dev? Here is my script for db:migrate:
import { drizzle } from "drizzle-orm/neon-http";
import { neon } from "@neondatabase/serverless";
import { migrate } from "drizzle-orm/neon-http/migrator";
import { config } from "dotenv";

config();

const sql = neon(process.env.DATABASE_URL!);
const db = drizzle(sql);

const main = async () => {
try {
await migrate(db, { migrationsFolder: "./src/server/db/migrations" });
console.log("Migration completed...");
} catch (error) {
console.error("Error during migration:", error);
process.exit(1);
}
};

void main();
import { drizzle } from "drizzle-orm/neon-http";
import { neon } from "@neondatabase/serverless";
import { migrate } from "drizzle-orm/neon-http/migrator";
import { config } from "dotenv";

config();

const sql = neon(process.env.DATABASE_URL!);
const db = drizzle(sql);

const main = async () => {
try {
await migrate(db, { migrationsFolder: "./src/server/db/migrations" });
console.log("Migration completed...");
} catch (error) {
console.error("Error during migration:", error);
process.exit(1);
}
};

void main();
Can someone help me determine why we aren't moving forward?
2 Replies
xenial-black
xenial-blackOP2y ago
LOL I used 'next dev' instead of 'next build' 🤡
exotic-emerald
exotic-emerald2y ago
😂 happens to the best of us! Good to see you figured it out

Did you find this page helpful?