use vite+

This commit is contained in:
Amruth Pillai
2026-03-18 22:03:24 +01:00
parent d1dac8aeca
commit 192880e416
427 changed files with 58915 additions and 58759 deletions
+17 -17
View File
@@ -4,28 +4,28 @@ import { definePlugin } from "nitro";
import { Pool } from "pg";
async function migrateDatabase() {
console.log("⌛ Running database migrations...");
console.log("⌛ Running database migrations...");
const connectionString = process.env.DATABASE_URL;
const connectionString = process.env.DATABASE_URL;
if (!connectionString) {
throw new Error("DATABASE_URL is not set");
}
if (!connectionString) {
throw new Error("DATABASE_URL is not set");
}
const pool = new Pool({ connectionString });
const db = drizzle({ client: pool });
const pool = new Pool({ connectionString });
const db = drizzle({ client: pool });
try {
await migrate(db, { migrationsFolder: "./migrations" });
console.log("✅ Database migrations completed");
} catch (error) {
console.error("🚨 Database migrations failed:", error);
throw error;
} finally {
await pool.end();
}
try {
await migrate(db, { migrationsFolder: "./migrations" });
console.log("✅ Database migrations completed");
} catch (error) {
console.error("🚨 Database migrations failed:", error);
throw error;
} finally {
await pool.end();
}
}
export default definePlugin(async () => {
await migrateDatabase();
await migrateDatabase();
});