MP040WARNINGAuto-fixableFree

prefer-timestamptz

What It Detects

TIMESTAMP without timezone causes timezone-related bugs.

Why It's Dangerous

TIMESTAMP WITHOUT TIME ZONE stores a raw datetime without timezone context. When your application or database server changes timezones, all values silently become wrong. Use TIMESTAMPTZ.

Bad Example

ALTER TABLE events ADD COLUMN created_at TIMESTAMP;

Good Example

ALTER TABLE events ADD COLUMN created_at TIMESTAMPTZ;

Auto-fix

Run migrationpilot analyze file.sql --fix to automatically fix this violation.

Configuration

Disable this rule:

# .migrationpilotrc.yml
rules:
  MP040: false

Or change its severity:

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