2023-05-22 12:14:37 -04:00
|
|
|
import { migrate } from "drizzle-orm/vercel-postgres/migrator";
|
|
|
|
|
import { db } from "./schema";
|
|
|
|
|
import * as dotenv from "dotenv";
|
|
|
|
|
|
|
|
|
|
dotenv.config();
|
|
|
|
|
|
2023-06-02 11:57:44 -04:00
|
|
|
// @ts-ignore
|
2023-05-22 12:14:37 -04:00
|
|
|
migrate(db, {
|
|
|
|
|
migrationsFolder: "lib/db/migrations",
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
console.log("Migration was succesfull!");
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.error("Migration failed:", err);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
console.info("Migration finished");
|
|
|
|
|
});
|