- runMigrations (postgres) no longer delegates to drizzle's postgres-js
migrator: shared per-statement, skip-by-hash loop (applyMigrationsByHash)
applies migrations in journal order regardless of 'when' timestamps.
Fixes#1402 D1 (0009/0010 silently skipped on 0008-era upgrades —
reproduced on real postgres: old path leaves 15/17, new path 17/17) and
D2 (single-transaction wrap breaking 0009's ALTER TYPE sequence).
- runPgliteMigrations refactored onto the same core; behavior preserved
(pre-existing PGlite migrate tests pass unchanged).
- New getMigrationStatus(): ledger-vs-journal completeness, read-only,
never creates a ledger — an unmigrated DB reports 0/N (the #1389
signature).
- Gateway startup (DatabaseModule.onModuleInit) verifies postgres schema
after adapter.migrate() and REFUSES to start on incomplete (15/17-style)
schemas, with remediation pointing at #1392/#1402.
- 'mosaic gateway install'/'verify' gain a database-schema check: postgres
tiers get explicit runMigrations + completeness verification against the
config the installed gateway actually resolves (daemon config priority).
Install hard-fails on failed schema verification (fast-fail), closing the
T63 failure mode where install reported success over an empty DB.