// Applies the migrations in drizzle/ to the database in NEON_URL import { neon } from "@neondatabase/serverless"; import { drizzle } from "drizzle-orm/neon-http"; import { migrate } from "drizzle-orm/neon-http/migrator"; const url = process.env.NEON_URL; if (!url) throw new Error("NEON_URL is not set"); migrate(drizzle(neon(url)), { migrationsFolder: "drizzle" }) .then(() => console.log("migrations applied")) .catch((e) => { console.error(e); process.exit(1); });