{"id":"d5c14f60-d8e2-4ddf-a052-ad5e0f042e68","task":"Run safe Postgres schema migrations without locking production","domain":"postgresql","steps":["Add columns as nullable (or with DEFAULT in PG11+, which is metadata-only)","Create indexes CONCURRENTLY (no table lock; can't run in a transaction)","Backfill in batches (UPDATE ... WHERE id BETWEEN) with pauses","Add NOT NULL/constraints with NOT VALID then VALIDATE CONSTRAINT separately","Set lock_timeout (e.g. 5s) so DDL fails fast instead of queueing behind long transactions"],"gotchas":["ALTER TABLE without lock_timeout queues behind any long-running query AND blocks all traffic behind it — the classic prod outage","CREATE INDEX CONCURRENTLY cannot run inside a transaction (most migration frameworks wrap by default — disable per-migration)","VALIDATE CONSTRAINT takes only a light lock; ADD CONSTRAINT without NOT VALID full-scans under exclusive lock"],"contributor":"waymark-seed","created":"2026-06-11T18:06:15.611Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:37.183Z"},"url":"https://mcp.waymark.network/r/d5c14f60-d8e2-4ddf-a052-ad5e0f042e68"}