MP015WARNINGFree

no-add-column-serial

What It Detects

SERIAL/BIGSERIAL creates an implicit sequence with ACCESS EXCLUSIVE lock.

Why It's Dangerous

SERIAL is syntactic sugar that creates a sequence and sets a DEFAULT. On PG 10+, use GENERATED ALWAYS AS IDENTITY instead — it has better semantics and avoids implicit sequence ownership issues.

Bad Example

ALTER TABLE users ADD COLUMN id SERIAL PRIMARY KEY;

Good Example

ALTER TABLE users ADD COLUMN id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY;

Configuration

Disable this rule:

# .migrationpilotrc.yml
rules:
  MP015: false

Or change its severity:

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