MP029WARNINGFree

ban-drop-not-null

What It Detects

DROP NOT NULL may break application code that assumes the column is never NULL.

Why It's Dangerous

Removing a NOT NULL constraint allows NULLs in a column that application code may assume is always populated. This can cause NullPointerExceptions and data integrity issues.

Bad Example

ALTER TABLE users ALTER COLUMN email DROP NOT NULL;

Good Example

-- Verify all application code handles NULL before dropping
-- Update validation logic, then:
ALTER TABLE users ALTER COLUMN email DROP NOT NULL;

Configuration

Disable this rule:

# .migrationpilotrc.yml
rules:
  MP029: false

Or change its severity:

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