MP053CRITICALFree

ban-uncommitted-transaction

What It Detects

Migration file contains BEGIN without a matching COMMIT, leaving a dangling open transaction.

Why It's Dangerous

A migration with BEGIN but no COMMIT will either fail (if the migration runner auto-commits) or leave an open transaction that holds locks indefinitely. Always match BEGIN with COMMIT or ROLLBACK.

Bad Example

BEGIN;
ALTER TABLE users ADD COLUMN bio text;
-- Missing COMMIT!

Good Example

BEGIN;
ALTER TABLE users ADD COLUMN bio text;
COMMIT;

Configuration

Disable this rule:

# .migrationpilotrc.yml
rules:
  MP053: false

Or change its severity:

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