* chore(release): v5.1.0

* feat: implement resume thumbnails

* fix: remove unused mcp tools

* docs: fix formatting of docs
This commit is contained in:
Amruth Pillai
2026-05-07 15:12:33 +02:00
committed by GitHub
parent 51c366310e
commit 50ba37a27f
1015 changed files with 106087 additions and 141872 deletions
+40
View File
@@ -0,0 +1,40 @@
import { existsSync } from "node:fs";
import path from "node:path";
import { drizzle } from "drizzle-orm/node-postgres";
import { migrate } from "drizzle-orm/node-postgres/migrator";
import { definePlugin } from "nitro";
import { Pool } from "pg";
import { env } from "@reactive-resume/env/server";
function resolveMigrationsFolder(): string {
let dir = import.meta.dirname;
while (dir !== path.dirname(dir)) {
const candidate = path.join(dir, "migrations");
if (existsSync(candidate)) return candidate;
dir = path.dirname(dir);
}
throw new Error(`Could not locate migrations folder relative to ${import.meta.dirname}`);
}
const migrationsFolder = resolveMigrationsFolder();
export default definePlugin(async () => {
console.info("Running database migrations...");
const connectionString = env.DATABASE_URL;
const pool = new Pool({ connectionString });
const db = drizzle({ client: pool });
try {
await migrate(db, { migrationsFolder });
console.info("Database migrations completed");
} catch (error) {
console.error("Database migrations failed", { error });
throw error;
} finally {
await pool.end();
}
});