MP061WARNINGFree

suboptimal-column-order

What It Detects

CREATE TABLE has variable-length columns before fixed-size columns, wasting alignment padding.

Why It's Dangerous

PostgreSQL stores columns in declaration order. Fixed-size types (int, bigint, timestamp, uuid) before variable-length types (text, jsonb, bytea) reduces alignment padding waste — saving 4-16 bytes per row on tables with mixed types.

Bad Example

CREATE TABLE users (
  name TEXT,
  bio TEXT,
  id INTEGER,
  age INTEGER
);

Good Example

CREATE TABLE users (
  id INTEGER,
  age INTEGER,
  name TEXT,
  bio TEXT
);

Configuration

Disable this rule:

# .migrationpilotrc.yml
rules:
  MP061: false

Or change its severity:

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