import path from "node:path"; import { migrate } from "drizzle-orm/better-sqlite3/migrator"; import type { AppDatabase } from "../../src/db/database-context.js"; /** * Applies all migrations. ES-module tests (tests/security) use this helper so * the migrator resolves the same Drizzle declarations as the application. */ export function migrateDatabase(database: AppDatabase): void { migrate(database, { migrationsFolder: path.resolve("src", "db", "migrations") }); }