supabase / cli

Supabase CLI. Manage postgres migrations, run Supabase locally, deploy edge functions. Postgres backups. Generating types from your database schema.
https://supabase.com/docs/reference/cli/about
MIT License
1.07k stars 209 forks source link

Can't reset database locally #1363

Closed bpbastos closed 1 year ago

bpbastos commented 1 year ago

Describe the bug I'm unable to reset the local database. I'm currently working on a project to migrate a legacy Yii2 system to Supabase. However, every time I attempt to execute 'npx supabase db reset' with the intention of running migrations and seeding the database, the command returns an error: 'database is not healthy.' As a result, neither the migrations nor the database seeding process is successful.

To Reproduce Steps to reproduce the behavior:

  1. Create a new migration/seed
  2. Try to run npx supabase db reset

Expected behavior Run the migrations and database seed

Desktop (please complete the following information):

sweatybridge commented 1 year ago

Could you try to restart the local development stack from a clean state? You can use the following commands

npx supabase stop --no-backup
npx supabase start
bpbastos commented 1 year ago

Could you try to restart the local development stack from a clean state? You can use the following commands

npx supabase stop --no-backup
npx supabase start

Doing as you suggested worked; the migrations and seeds were executed. I tried running 'npx supabase db reset' again to test, but it still returns 'database is not healthy'.

sweatybridge commented 1 year ago

I believe this is fixed in the latest beta release, ie. npx supabase@beta db reset. Feel free to reopen if you are still experiencing this issue.