Files
supabase/apps/docs/spec
21f7e306ee docs(cli): align declarative schema and diff engine docs with CLI behavior (#51609)
## Problem

Four docs pages describe CLI behavior that v2.120.0 no longer has. A
reader following them hits a wrong result in three places.

- The declarative guide tells legacy-engine users who ran `db pull
--declarative` to delete the exported tree. The command also rewrites
`[db.migrations].schema_paths` in `config.toml`, so `db diff` keeps
failing after the delete. The guide also claims the failure happens "on
the first file". The code does not guarantee that.
- The declarative directory moved from `supabase/database` to
`supabase/schemas` in v2.115.0. The CLI warns when it finds a tree at
the old path. No page mentions the move or the warning, and the `db
schema declarative sync` example in the command reference still prints
the old path.
- The command reference marks `--experimental` as required on the
declarative commands. `[experimental.pgdelta] enabled = true` also
unlocks them.

Two smaller gaps: the diff engines page shows how to fall back to
`migra` for one run but not how to try `pg-delta` for one run, and the
guide omits the note `db diff -f` prints when it ignores schema files.

Every claim was checked against the CLI source on `develop` and the
v2.120.0 tag.

## Solution

Docs-only change. Four files, 17 insertions, 8 deletions.

- `declarative-database-schemas.mdx`: corrects the legacy caution,
documents the pre-2.115.0 directory and its warning, adds the `db diff
-f` note.
- `diff-engines.mdx`: adds the single-run opt-in table (`db diff
--use-pg-delta`, `db pull --diff-engine pg-delta`, `--experimental` for
the declarative commands) and the `SUPABASE_EXPERIMENTAL_PG_DELTA`
override. Updates the legacy `db pull --declarative` row. Prettier
realigned the comparison table, which accounts for most of that page's
diff.
- `cli_v1_config.yaml`: `schema_paths` notes the automatic rewrite on
`migra` and the warning on `pg-delta`. `declarative_schema_path` notes
the pre-2.115.0 default.
- `cli_v1_commands.yaml`: fixes the example path and drops `required:
true` from `--experimental` on the two declarative commands. Both match
the spec the CLI generator produces from `develop`.

The command reference is generated from the CLI repo, so the same fixes
are in supabase/cli as a separate PR. Without that, the next release's
reference update reverts them here.

## Review instructions

1. Open the preview for
`/docs/guides/local-development/declarative-database-schemas` and search
for "schema_paths". The legacy caution should say the command rewrites
the setting and tell readers to remove it.
2. On the same page, search for "2.115.0". The directory note should
name the version and both fixes.
3. Open the preview for `/docs/guides/local-development/diff-engines`
and search for "single run". The opt-in table should render, and the
comparison table below it should still align.
4. Open the CLI reference for `db schema declarative sync`. The second
example should print `supabase/schemas`, and `--experimental` should not
show as required.
5. Open the config reference entries for `db.migrations.schema_paths`
and `experimental.pgdelta.declarative_schema_path` and read the added
sentences.
6. Optional source check in supabase/cli `develop`:
`updateDeclarativeSchemaPathsConfig` in
`apps/cli/src/commands/db/shared/pgdelta.write.ts` and
`apps/cli/src/commands/db/schema/declarative/declarative.former-default.ts`
back the two main claims.

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)

---------

Co-authored-by: avallete <andrew.valleteau@supabase.io>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 10:53:16 +00:00
..
2024-09-17 10:46:12 +02:00

Supabase Specs

These spec files are used to generate the reference documentation.

Preparation

To get started, run make init. This installs all dependencies.

Usage


make                # download and transform specs into docs