/** * Database migration script * Run with: bun run db:migrate */ import { migrate } from "drizzle-orm/bun-sqlite/migrator"; import { db } from "./connection"; import { createLogger } from "../core/logger"; const logger = createLogger("Database:Migrate"); async function runMigrations(): Promise { logger.info("Running database migrations..."); try { await migrate(db, { migrationsFolder: `${import.meta.dir}/drizzle`, }); logger.info("Migrations completed successfully"); } catch (error) { logger.error("Migration failed", error); process.exit(1); } } runMigrations();