MP071WARNINGFree

ban-rename-in-use-column

What It Detects

Renaming a column breaks views, functions, and triggers that reference the old name.

Why It's Dangerous

PostgreSQL does not automatically update views, functions, triggers, or policies when a column is renamed. All dependent objects continue referencing the old name and fail at query time.

Bad Example

ALTER TABLE users RENAME COLUMN name TO full_name;

Good Example

-- Safe add-copy-drop pattern:
ALTER TABLE users ADD COLUMN full_name TEXT;
UPDATE users SET full_name = name WHERE full_name IS NULL;
-- Update all views/functions, then drop old column

Configuration

Disable this rule:

# .migrationpilotrc.yml
rules:
  MP071: false

Or change its severity:

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