mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-27 22:25:58 +02:00
Fix migrate script
This commit is contained in:
parent
e76fc56e1a
commit
6d843fb22c
1 changed files with 5 additions and 1 deletions
|
@ -2,11 +2,15 @@ import { migrate } from "drizzle-orm/better-sqlite3/migrator";
|
||||||
import db from "@server/db";
|
import db from "@server/db";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
|
||||||
|
const migrationsFolder = path.join(__dirname, "../server/migrations");
|
||||||
|
console.log(migrationsFolder);
|
||||||
|
|
||||||
|
|
||||||
const runMigrations = async () => {
|
const runMigrations = async () => {
|
||||||
console.log("Running migrations...");
|
console.log("Running migrations...");
|
||||||
try {
|
try {
|
||||||
migrate(db, {
|
migrate(db, {
|
||||||
migrationsFolder: path.join(__dirname, "server/migrations"),
|
migrationsFolder: migrationsFolder,
|
||||||
});
|
});
|
||||||
console.log("Migrations completed successfully.");
|
console.log("Migrations completed successfully.");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue