Skip to content

Conversation

@iAmLakshya
Copy link

@iAmLakshya iAmLakshya commented Dec 22, 2025

What kind of change does this PR introduce?

Feature (UX improvement)

What is the current behavior?

When running supabase db push, users see a generic prompt without any indication of which project they're pushing to:

  Do you want to push these migrations to the remote database?
   • 20240101000000_create_users.sql

  Finished supabase db push.

This can lead to accidentally pushing migrations to the wrong project when working with multiple Supabase projects. Users must rely on checking their .supabase/project-ref file or running supabase link to verify which project is linked.

What is the new behavior?

The command now fetches project details via the Management API and displays the project name and ID before prompting:

  Pushing to linked project: My App (abcdefghijklmnop)
  Do you want to push these migrations to the remote database?
   • 20240101000000_create_users.sql

  Finished supabase db push.

Scope:

  • Applies when pushing to a linked project (default --linked flag)
  • Does not apply when using --db-url (direct connection string) or --local flags, since there's no linked project in those cases

Files changed:

  • internal/db/push/push.go - Added projectRef parameter and printProjectInfo() function
  • cmd/db.go - Pass flags.ProjectRef to the push command
  • internal/bootstrap/bootstrap.go - Updated call signature (passes empty string for local bootstrap)
  • internal/db/push/push_test.go - Updated tests with new parameter

Additional context

This aligns with the existing behavior of supabase config push, which already displays project info before making changes:

Pushing config to project: abcdefghijklmnop

The implementation uses the existing V1GetProjectWithResponse API call (same pattern used in internal/link/link.go and internal/utils/tenant/database.go) to fetch the project name.

@iAmLakshya iAmLakshya requested a review from a team as a code owner December 22, 2025 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant