feat: add migration runner with structured failure diagnostic (E00-S03-T05)
MigrationRunner applies pending migrations through the migration ledger exactly once; when a migration fails it throws a MigrationFailedError whose diagnostic is a structured object identifying the failing migration (version), the failure phase (apply/record), the underlying cause, and the applied/pending ledger state, serializable via toJSON. Re-exported from the driver boundary so no other package needs the pg driver to run migrations. Advisory lock (T04) and ready gate (T06) remain out of scope.
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
* Migration ledger — [E00-S03-T03].
|
||||
*
|
||||
* The ledger is the PostgreSQL table that records applied migrations, so the
|
||||
* migration runner (built on this boundary in later stories — advisory lock
|
||||
* E00-S03-T04, failure diagnostic E00-S03-T05) can tell which migrations have
|
||||
* migration runner (built on this boundary — the advisory lock E00-S03-T04
|
||||
* and the failure diagnostic E00-S03-T05) can tell which migrations have
|
||||
* already been applied and apply the rest exactly once.
|
||||
*
|
||||
* The ledger lives in `database-postgres` — the single workspace package
|
||||
|
||||
Reference in New Issue
Block a user