v0.5.0a9 — idempotent migration 013
Pre-release
Pre-release
Patch release for the migration 013 idempotency fix (#67, #68).
Fixed
- Migration
013_relationships_unique.sqlre-runs cleanly instead of looping forever.ALTER TABLE ... ADD CONSTRAINThas noIF NOT EXISTSin Postgres, so re-applying 013 on a database whererelationships_ns_edge_uniquealready existed — the constraint applied out-of-band, or itspgrg_applied_migrationsrow lost to a backup/restore taken between the schema change and the bookkeeping commit — raised42710 duplicate_object. Because the migration runs in one transaction, that rolled it back and never recorded it, so every subsequent startup /pgrg migrateretried and failed again (the partial-migration-not-tracked loop). The constraint add is now wrapped in apg_constraintexistence guard, so the migration converges to the same end state on the first run and any repeat run. Steps 1-2 (dedup DML) were already idempotent. Addstest_migration_013_is_rerunnable.
Upgrade note: any database currently stuck in the 013 failure loop converges automatically on the next startup or pgrg migrate.