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:
@@ -3,8 +3,8 @@
|
||||
*
|
||||
* The advisory lock is the PostgreSQL-side guarantee that concurrent migration
|
||||
* runners cannot run at the same time: the migration runner (built on this
|
||||
* boundary in later stories — failure diagnostic E00-S03-T05, ready gate
|
||||
* E00-S03-T06) takes the lock before applying migrations, so a second runner
|
||||
* boundary — the failure diagnostic E00-S03-T05; the ready gate E00-S03-T06)
|
||||
* takes the lock before applying migrations, so a second runner
|
||||
* either waits (`acquire()`) or fails fast (`tryAcquire()`) while the first
|
||||
* holds it.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user