Bug report
Describe the bug
supabase db reset with --workdir flag fails to apply migrations and ignores custom sql_paths from config.toml.
Root cause analysis
The CLI appears to:
- Ignore
sql_paths from config.toml when using --workdir - Only look for the default
supabase/seed.sql path - Not apply app migrations (only Supabase internal migrations)
The bug is in --workdir path resolution, not specific to SUPABASE_PROJECT_ID.
Expected behavior
db reset should read sql_paths from config.toml and apply those seed filesdb reset should apply all migrations from the migrations/ directory
Workaround
Bypass supabase db reset and apply migrations/seeds manually via docker exec psql.
System information
- OS: macOS (Darwin 24.5.0)
- Supabase CLI version: 2.72.7
- Docker version: Docker Desktop
Minimal repro (verified)
- Create a monorepo-like layout
mkdir -p repro/apps/supabase
cd repro
- Init Supabase in the subdir
supabase init --workdir apps/supabase
- Add one migration + one seed file
mkdir -p apps/supabase/migrations
mkdir -p apps/supabase/seed/base
cat > apps/supabase/migrations/20250101000000_init.sql <<'SQL'
create table public.test_repro(id int primary key);
SQL
cat > apps/supabase/seed/base/01-seed.sql <<'SQL'
insert into public.test_repro values (1);
SQL
- Configure custom
sql_paths in config.toml
cat >> apps/supabase/config.toml <<'TOML'
[db.seed]
enabled = true
sql_paths = ["./seed/base/01-seed.sql"]
TOML
- Run with
--workdir
supabase start --workdir apps/supabase
supabase db reset --workdir apps/supabase --yes
Observed output:
Seeding globals from roles.sql...
WARN: no files matched pattern: supabase/seed.sql
Observed DB state:
$ docker exec -i supabase_db_supabase psql -U postgres -d postgres -c "\\dt public.*"
Did not find any relation named "public.*".
Expected:
- migration from
migrations/ applied - seed from
sql_paths applied
Bug report
Describe the bug
supabase db resetwith--workdirflag fails to apply migrations and ignores customsql_pathsfrom config.toml.Root cause analysis
The CLI appears to:
sql_pathsfrom config.toml when using--workdirsupabase/seed.sqlpathThe bug is in
--workdirpath resolution, not specific toSUPABASE_PROJECT_ID.Expected behavior
db resetshould readsql_pathsfrom config.toml and apply those seed filesdb resetshould apply all migrations from themigrations/directoryWorkaround
Bypass
supabase db resetand apply migrations/seeds manually via docker exec psql.System information
Minimal repro (verified)
sql_pathsinconfig.toml--workdirObserved output:
Observed DB state:
Expected:
migrations/appliedsql_pathsapplied