mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-24 17:03:55 +10:00
use vite+
This commit is contained in:
+12
-12
@@ -5,21 +5,21 @@ import { Pool } from "pg";
|
||||
import { env } from "@/utils/env";
|
||||
|
||||
export async function migrateDatabase() {
|
||||
console.log("⌛ Running database migrations...");
|
||||
console.log("⌛ Running database migrations...");
|
||||
|
||||
const pool = new Pool({ connectionString: env.DATABASE_URL });
|
||||
const db = drizzle({ client: pool });
|
||||
const pool = new Pool({ connectionString: env.DATABASE_URL });
|
||||
const db = drizzle({ client: pool });
|
||||
|
||||
try {
|
||||
await migrate(db, { migrationsFolder: "./migrations" });
|
||||
console.log("✅ Database migrations completed");
|
||||
} catch (error) {
|
||||
console.error("🚨 Database migrations failed:", error);
|
||||
} finally {
|
||||
await pool.end();
|
||||
}
|
||||
try {
|
||||
await migrate(db, { migrationsFolder: "./migrations" });
|
||||
console.log("✅ Database migrations completed");
|
||||
} catch (error) {
|
||||
console.error("🚨 Database migrations failed:", error);
|
||||
} finally {
|
||||
await pool.end();
|
||||
}
|
||||
}
|
||||
|
||||
if (import.meta.main) {
|
||||
await migrateDatabase();
|
||||
await migrateDatabase();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user