Skip to content

no-pg-enum

CREATE TYPE ... AS ENUM — use TEXT with an application enum instead.

Why

PostgreSQL enums make ordinary value changes operationally awkward and couple application evolution to database type migrations.

Fix

Store the value as TEXT and validate its allowed values at the typed application boundary.

Examples

Before — flagged PostgreSQL enum type
supabase/migrations/001_status.sql
CREATE TYPE call_status AS ENUM('pending', 'active', 'completed');
After — preferred Text column whose closed values are application-owned
supabase/migrations/001_status.sql
CREATE TABLE
CALL (status TEXT NOT NULL);