import { fileURLToPath } from 'node:url'; import { dirname, join } from 'node:path'; import { openDb, migrate } from './db.mjs'; const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..'); const file = process.env.DB_FILE || join(ROOT, 'data', 'mail-gateway.sqlite'); const db = openDb(file); console.log(` DB: ${file}`); migrate(db, join(ROOT, 'migrations')); db.close();