Try to use drizzle event though

This commit is contained in:
Jared Palmer 2023-05-22 12:14:37 -04:00
parent f14e73ac8f
commit d88eae7230
14 changed files with 1978 additions and 12 deletions

18
lib/db/migrate.ts Normal file
View file

@ -0,0 +1,18 @@
import { migrate } from "drizzle-orm/vercel-postgres/migrator";
import { db } from "./schema";
import * as dotenv from "dotenv";
dotenv.config();
migrate(db, {
migrationsFolder: "lib/db/migrations",
})
.then(() => {
console.log("Migration was succesfull!");
})
.catch((err) => {
console.error("Migration failed:", err);
})
.finally(() => {
console.info("Migration finished");
});