import { resolve } from "node:path"; import { runMigrations } from "./migrate.js"; const index = process.argv.indexOf("--dir"); void runMigrations(resolve(index < 0 ? "migrations" : process.argv[index + 1] ?? "migrations")) .then((files) => console.log({ applied: files })) .catch(() => { console.error("Migration failed; schema remains unready. Inspect the phase and database records before retrying."); process.exitCode = 1; });