MP073CRITICALFree

ban-superuser-role

What It Detects

Migration uses superuser-only operations. Migrations should run with minimal privileges.

Why It's Dangerous

Running migrations as SUPERUSER is a security risk. Managed database services (RDS, Cloud SQL, Neon, Supabase) do not grant SUPERUSER access, so these operations will fail in production.

Bad Example

ALTER SYSTEM SET max_connections = '200';

Good Example

ALTER DATABASE mydb SET max_connections = '200';

Configuration

Disable this rule:

# .migrationpilotrc.yml
rules:
  MP073: false

Or change its severity:

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