Try to use drizzle event though
This commit is contained in:
parent
f14e73ac8f
commit
d88eae7230
14 changed files with 1978 additions and 12 deletions
18
lib/db/migrate.ts
Normal file
18
lib/db/migrate.ts
Normal 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");
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue