Supabase Releases Declarative Schemas 2.0 Powered by In-House Tool pg-delta
Supabase has introduced Declarative Schemas 2.0 for its CLI, replacing Python-based migra with an open-source tool called pg-delta. This change enables automatic migration generation for Postgres elements like Row Level Security policies, grants, and domains.

Supabase announced Declarative Schemas 2.0, upgrading the schema diffing engine in the Supabase CLI from the legacy Python tool migra to an open-source engine called pg-delta. Existing projects can opt into version 2.0, while newly created projects will use it by default. The core developer workflow remains unchanged, allowing engineers to modify local SQL schema files under the schemas directory and generate migrations automatically.
Primary source
Open Supabase Blog ↗This article summarizes the source. Check the original for full details and conditions.
Comparison
| Aspect | Before / Alternative | After / This |
|---|---|---|
| Diffing Engine | migra (Python-based) | pg-delta (Open-source) |
| Supported Schema Elements | Missed domains, publications, comments, and RLS policies, requiring manual SQL fixes | Automatically detects changes in RLS policies, grants, views, partitions, and domains |
Action Checklist
- Opt in to Declarative Schemas 2.0 in existing project configurations New projects will use version 2.0 by default.
- Modify local schema files in the supabase/schemas directory and generate migration files via the Supabase CLI Verify generated migration scripts before applying them to production.



