cli
cli copied to clipboard
CLI commands are inconsistent in regards to local/remote project usage
Describe the bug
Some commands that don't qualify the project use the local project (supabase migration up, supabase db reset) by default, while others use the remote project. This can easily lead to mistakes that affect production. Also the feedback from the CLI can add confusion (see example below).
To Reproduce Steps to reproduce the behavior:
- Be connected to remote project (
supabase db link) - Run a migration locally; remove the file (e.g. because you change the git branch)
- Run
supabase migration up - The CLI now gives the feedback:
Make sure your local git repo is up-to-date. If the error persists, try repairing the migration history table: supabase migration repair --status reverted 20241016101752 - Run that command
- Suprisingly, the remote project is being affected
Expected behavior Only the local project should be affected – the CLI gave the hint, and in both cases, the command is not being qualified by a flag that would indicate a different project
Additional context If applicable, add any other context about the problem here.
- Supabase CLI version: 1.187.10