MP060CRITICALFree

alter-type-rename-value

What It Detects

ALTER TYPE RENAME VALUE is not replicated via logical replication, causing enum mismatches on subscribers.

Why It's Dangerous

RENAME VALUE modifies the pg_enum catalog entry in-place. Logical replication does not replicate catalog changes. Subscribers retain the old value name, causing decode failures on replicated rows.

Bad Example

ALTER TYPE status RENAME VALUE 'active' TO 'enabled';
-- Subscribers still have 'active', not 'enabled'

Good Example

-- Add new value, migrate data:
ALTER TYPE status ADD VALUE 'enabled';
UPDATE events SET status = 'enabled' WHERE status = 'active';

Configuration

Disable this rule:

# .migrationpilotrc.yml
rules:
  MP060: false

Or change its severity:

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