MP068WARNINGFree

warn-integer-pk-capacity

What It Detects

Sequence uses integer type (max ~2.1B). Use bigint to avoid expensive future migration.

Why It's Dangerous

Integer sequences overflow at ~2.1 billion (int4) or ~32,000 (int2). When a sequence overflows, all INSERTs fail. Migrating from integer to bigint on a live sequence requires rewriting the dependent column under ACCESS EXCLUSIVE lock.

Bad Example

CREATE SEQUENCE user_id_seq AS integer;

Good Example

CREATE SEQUENCE user_id_seq AS bigint;

Configuration

Disable this rule:

# .migrationpilotrc.yml
rules:
  MP068: false

Or change its severity:

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