
Declarative Schemas 2.0 gives the Supabase CLI a broader migration engine, so generated migrations no longer omit changes such as RLS policies, grants, view settings, partitions and domains.
Supabase shipped the update on 2 October 2026 and detailed it in a blog post. It replaces migra, the engine used by supabase db diff since the first CLI prototype in 2021, with a new open-source Postgres diff tool called pg-delta.
The declarative workflow remains the same. You keep SQL schema files under supabase/schemas/, edit those files, ask the CLI to generate a migration, review the resulting SQL and apply it.
What Declarative Schemas 2.0 Now Captures
The previous engine did not understand some Postgres objects, including domains, publications and comments. Those changes would not appear in its output, leaving developers to add versioned migrations by hand.
pg-delta expands the objects and operations the CLI can track:
| Area | Generated migration support |
|---|---|
| RLS policies | Create, drop and alter changes |
| Access control | Grants and roles |
| Database structure | View settings, partitions and domains |
| Other objects | Comments, publication membership and extension-managed objects |
The new engine also filters ownership per object rather than at schema level. Supabase-managed objects, such as the contents of the auth schema, can stay out of a diff while a developer-owned trigger attached to auth.users can still be included.
This per-object filtering extends to roles, grants and objects owned by extensions. Supabase built pg-delta from scratch and released it as open source.
New Projects Get the Engine by Default
New CLI projects use Declarative Schemas 2.0 automatically. Existing projects can opt in by adding a config block.
The release also introduces dependency-graph ordering for schema files. This allows the CLI to arrange files according to their database dependencies rather than relying only on their position in the directory.
A new db schema declarative generate command exports a live database into declarative schema files. That provides a route for bringing an existing database into the file-based workflow, alongside Supabase's wider move to put backend setup into repositories.
Frequently asked questions
What is Supabase Declarative Schemas 2.0?
Declarative Schemas 2.0 is a CLI workflow that turns SQL schema files into database migrations. It uses the open-source pg-delta engine to detect a wider range of Postgres changes.
How does Declarative Schemas 2.0 compare with the previous version?
The previous implementation used migra and could miss domains, publications, comments and some other database changes. Version 2.0 uses pg-delta, adds per-object filtering and covers RLS policy changes, grants, view settings, partitions, roles and extension-managed objects.
When is Declarative Schemas 2.0 available?
Supabase shipped it on 2 October 2026. New CLI projects receive it by default, while existing projects can enable it through a config block.
Sources
3 checkedHow we cover tool news: Create With's tool desk drafts these reports with AI from the sources listed above and checks them against those sources before publishing.







