Declarative Schemas 2.0 with pg-delta
Blog post from Supabase
Supabase’s Declarative Schemas 2.0 replaces the migra-based migration diff engine with pg-delta, an open-source PostgreSQL catalog-driven tool that generates SQL migrations from schema files while expanding support for RLS policy alterations, grants, view settings, comments, roles, domains, partitions, publications, extension-managed objects, and more. Developers define SQL schemas under `supabase/schemas`, use the CLI to compare them with migration history in temporary shadow databases, review the generated migration, and apply it, with dependency ordering handled automatically rather than through manually ordered files. New CLI projects use pg-delta by default, while existing projects can opt in through an experimental configuration setting and require Supabase CLI 2.119 or newer. pg-delta warns about unsupported objects and can fail CI in strict-coverage mode, but generated migrations still require careful review because changes such as column renames may be expressed as destructive drop-and-add operations. The engine does not generally manage table data, storage buckets, zero-downtime deployment orchestration, ORM integrations, or PostgreSQL versions earlier than 14, though it handles some extension configuration stored as rows through extension APIs. Available independently on npm for comparing PostgreSQL 14 through 18 databases, pg-delta remains in alpha and is also used internally by Supabase for branch merge diffs, schema exports, and production drift detection.
| Trend | Post Mentions | Total Month Mentions | Posts | Companies | MoM |
|---|---|---|---|---|---|
| Real-time | 1 | 1,841 | 506 | 164 | -62% |
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.