MIG002errorPro
migration-failure-masked
Schema migration command with its exit code suppressed (|| true, || echo, ; exit 0) or force-stamped after an upgrade
Applies to: Docker, Shell, YAML
Why this matters
A migration that fails during deploy MUST fail the deploy. `migrate ... || true` keeps the rollout green while the schema silently stops matching the code; the failure surfaces days later as a missing-column error in a request path, with the deploy that caused it long out of sight. Stamping head after an upgrade additionally records the failure as success, so even re-running migrations won't repair the drift.
Catch it before it ships
pip install stablestack # or: npx stablestackstablestack # scans your project, MIG002 includedstablestack explain MIG002MIG002 is part of the Pro rule set. See pricing — the free tier ships 24 checks with no signup.
False positive in your codebase? Suppress a single line with # noqa: MIG002