MP020WARNINGAuto-fixableFree

require-statement-timeout

What It Detects

Long-running DDL without a preceding SET statement_timeout.

Why It's Dangerous

Without statement_timeout, a DDL operation that encounters unexpected conditions (bloated table, heavy WAL, slow I/O) can hold locks for hours, turning a routine migration into a full outage.

Bad Example

CREATE INDEX CONCURRENTLY idx_users_email ON users (email);

Good Example

SET statement_timeout = '30s';
CREATE INDEX CONCURRENTLY idx_users_email ON users (email);
RESET statement_timeout;

Auto-fix

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

Configuration

Disable this rule:

# .migrationpilotrc.yml
rules:
  MP020: false

Or change its severity:

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