MP004CRITICALAuto-fixableFree

require-lock-timeout

What It Detects

DDL operations should set lock_timeout to prevent blocking the lock queue indefinitely.

Why It's Dangerous

Without lock_timeout, if the table is locked by another query, your DDL waits indefinitely. All subsequent queries pile up behind it in the lock queue, causing cascading timeouts across your application.

Bad Example

ALTER TABLE users ADD COLUMN bio TEXT;

Good Example

SET lock_timeout = '5s';
ALTER TABLE users ADD COLUMN bio TEXT;
RESET lock_timeout;

Auto-fix

Run migrationpilot analyze file.sql --fix to automatically fix this violation.

Configuration

Disable this rule:

# .migrationpilotrc.yml
rules:
  MP004: false

Or change its severity:

# .migrationpilotrc.yml
rules:
  MP004:
    severity: warning