Skip to content

db diff: empty schema_paths glob is now a fatal error in v2.108.0 (regression from 2.107.0) #5700

Description

@rifflock

Describe the bug

In v2.108.0, supabase db diff --schema ... (declarative diff) aborts when any entry in [db.migrations].schema_paths matches zero files:

no files matched pattern: supabase/schemas/materialized_views/*.sql
Try rerunning the command with --debug to troubleshoot the error.

(exit code 1)

On v2.107.0 the same project + config diffs cleanly (exit 0) — an unmatched glob entry was silently skipped. This is a regression, almost certainly from the TypeScript port of db diff / db schema declarative called out in the v2.108.0 release notes ("Core database and storage commands now TypeScript-native — db diff … fully ported").

To Reproduce

  1. Use the declarative-schema workflow with schema_paths in config.toml, including a glob that currently matches no files — a normal incremental-adoption pattern (declare the path before populating it):

    [db.migrations]
    enabled = true
    schema_paths = [
      "./schemas/tables/*.sql",
      "./schemas/materialized_views/*.sql",   # no .sql files here yet
      "./schemas/views/*.sql",
    ]
  2. Run supabase db diff --schema public (declarative shadow diff, no --db-url).

  • v2.107.0: completes, exit 0.
  • v2.108.0: no files matched pattern: .../materialized_views/*.sql, exit 1.

Expected behavior

A schema_paths glob that matches no files should be skipped (the ≤2.107.0 behavior), not abort the command. Declaring a path ahead of populating it is a legitimate pattern and shouldn't be fatal.

Impact

Breaks any CI that runs db diff for declarative-schema projects with a not-yet-populated schema_paths entry — drift checks, diff, and migration generation all fail on every run. Current workaround: pin supabase/setup-cli to 2.107.0.

System information

  • CLI version: 2.108.0 (regression vs 2.107.0)
  • OS: reproduced on macOS (darwin/arm64) and ubuntu-24.04 (GitHub Actions runner)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions